Form Help
Posted on
16th Feb 2014 07:03 pm by
admin
Here is the form:
Line number On/Off | Expand/Contract<? include("../include/session.php"); ?> <?php if ($submit) { $sql = "UPDATE productimages SETtitle='".$_POST['title']."', upjpg='".$_POST['upjpg']."',uptiff='".$_POST['uptiff']."',uppng='".$_POST['uppng']."', chungshi='".$_POST['chungshi']."', stretchwalker='".$_POST['stretch_walker']."',akaishi='".$_POST['akaishi']."', bellamargiano='".$_POST['bellamargiano']."',mbt='".$_POST['mbt']."', upthumb='".$_POST['upthumb']."'where id ='".mysql_real_escape_string($_POST['id'])."'"; $result = mysql_query($sql) or die(mysql_error()); print("Product Added"); } else { $result = mysql_query("SELECT * FROM productimages WHERE id = '$id'"); while ($row=mysql_fetch_array($result)) { $id = $row[id]; $uptiff = $row[uptiff]; $upjpg = $row[upjpg]; $uppng = $row[uppng]; $chungshi = $row[chungshi]; $stretchwalker = $row[stretchwalker]; $akaishi = $row[akaishi]; $bellamargiano = $row[bellamargiano]; $mbt = $row[mbt]; $upthumb = $row[upthumb]; } print (" <form method=post action=productimages2.php>Product Title:
<input type=text name=title size=60>
Choose Categories that this story is relevant to:
<input type=checkbox name=chungshi value=1> Chung Shi
<input type=checkbox name=stretchwalker value=1> Stretchwalker
<input type=checkbox name=akaishi value=1> Akaishi
<input type=checkbox name=bellamargiano value=1> Bellamargiano
<input type=checkbox name=mbt value=1> MBT
<table width=500 cellpadding=0 cellspacing=0> <tr><td colspan=2 class=top><strong>Images</strong></td></tr> <tr><td>Upload JPG</td><td>
<input type=file name=upjpg></td></tr><tr><td colspan=2 class=top> </td></tr><tr><td>Upload TIFF</td><td>
<input type=file name=uptiff> </td></tr><tr><td colspan=2 class=top> </td></tr><tr><td>Upload PNG</td><td>
<input type=file name=uppng> </td></tr><tr><td colspan=2 class=top> </td></tr><tr><td>Upload Thumbnail</td><td>
<input type=file name=upthumb> </td></tr></table>
<input type=submit name=submit value=submit>
</form> "); } ?>
Here is the sql connection:
Line number On/Off | Expand/Contract<?php$con = mysql_connect("localhost", "user", "pass");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("database", $con);$sql = "insert into productimages ('".mysql_real_escape_string($_POST['title'])."', '".mysql_real_escape_string($_POST['chungshi'])."', '".mysql_real_escape_string($_POST['stretchwalker'])."', '".mysql_real_escape_string($_POST['akaishi'])."', '".mysql_real_escape_string($_POST['bellamargiano'])."', '".mysql_real_escape_string($_POST['mbt'])."', '".mysql_real_escape_string($_POST['upjpg'])."', '".mysql_real_escape_string($_POST['uptiff'])."', '".mysql_real_escape_string($_POST['uppng'])."', '".mysql_real_escape_string($_POST['upthumb'])."')";mysql_query($sql) or die(mysql_error()." <br /> $sql"); echo "The following information was entered into the database
";echo "<b>Title:</b> $_POST[title]
"; echo "Thanks for taking the time to submit your information."; mysql_close($con); ?>
And here is the error I'm getting:
Quote:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''asdfasdf', '', '', '', '1', '', '', '', '', '')' at line 1
insert into productimages ('asdfasdf', '', '', '', '1', '', '', '', '', '')
No comments posted yet
Your Answer:
Login to answer
296 11
Other forums
Include ("Absolute Path") of a file?
I'm not sure what I'm doing wrong. I am writing my php code in the same directory of the file that
registration form
first time posting. did some searches but didnt find exactly what i am looking for. dont flame cause
CURL question
i am wondering if it's possible to use multi curl with login something like
login once to web
Get relative path from absolute path
How would one go about getting the relative path to a file from its absolute path?
Socket problem
Hello,
Earlier I posted about my problem with my socket script. It took up to 100% CPU usage.
need a script for 3 pages
I have a customer who wants me to set up a site with a number of pages with the following requiremen
DateTimeZone::listIdentifiers headache
http://php.net/manual/en/datetimezone.listidentifiers.php
So the documentation states tha
check_changed_data - I can't get data from the called method event
I use check_changed_data to trigger my event method.
The method delivers er_changed_data.
Need help in Generating Combinations
Need help generating all possible combination of names in an array
Lets say i have the follow
Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I d