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', '', '', '', '', '')
Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing, yahoo, etc) but not AOL. Here's the code that doesn't' work. Can anyone help?else if
Query issues
I probably have this setup wrong well I know I do because nothing is showing up now. What I want is for it to show all the character names that are assigned to each user so yes than can be more than
Sql and php order list script problems
Hi im having a few problems with trying to get the coding right on a orders list ive done (or trying to do) for a custom shopping cart im making... For some reason it comes up with all the orders in
TemplatePower & AJAX
Hi all,I'm currently implementing some AJAX features in my PHP-framework (which is based on TemplatePower) and I have encountered a problem:I have a block which holds a message-div. This block is
Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website membership from on their computer. He's afraid that the users might share their login's with their
Tree Menu
Hi guys,Can anyone help me making a tree navigation system? I have a site where I'm allowing users to upload their files to share with each other. They can create folders, but I'm having real
What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is going wrong. It's a set of filters for events. The filter marked "type" (category) works
small inaccuracies
I have this code to convert fractional base 10 into base 2: while($num > 0) { echo "<tr><td>". $num." * 2 =
Display certain image depending on time of year
Hi, I am new to these forums and would really appreciate some advice on a piece of coding I have done.Basically what I am trying to do is on our intranet, display a different home page banner
Output Buffering question
Hi all, I've been trying to wrap my head around output buffering. So far I've found tons of benifits but I'm wondering about the downside of output buffering. Problems it creates, whether or not it