Urbley Posted March 3, 2007 Share Posted March 3, 2007 case "performEdit": { $postID = $_GET["postID"]; $title = $_GET["title"]; $dateAdded = $_GET["dateAdded"]; $contents = $_GET["contents"]; echo "$postId"; echo "$title"; echo "$dateAdded"; echo "$contents"; $db = mysql_connect("********", "**********", "****"); mysql_select_db("db65694326",$db); $dbQuery="UPDATE stephensBlog SET title='$title', dateAdded='$dateAdded', content='$contents' WHERE postID='$postID'"; $result=mysql_query($dbQuery,$db); echo "<script>alert('Your entry has been edited');window.location='blogAdmin.php?username=$username&password=$password';</script>"; break; } The syntax works fine on my other switches and the variables are definitely being received by the switch fine (I checked with some echo statements and what not). When I retrieve the database info and display it the values come up as $title $dateAdded and $contents. rather than the proper values... What's up with this? Steve Link to comment https://forums.phpfreaks.com/topic/41035-strange-sql-behaviour/ Share on other sites More sharing options...
LazyJones Posted March 3, 2007 Share Posted March 3, 2007 Using single quotes with variables inside double quotes will print the variable name (not the value) you'll need to escape those single quotes (\) Link to comment https://forums.phpfreaks.com/topic/41035-strange-sql-behaviour/#findComment-198711 Share on other sites More sharing options...
genericnumber1 Posted March 3, 2007 Share Posted March 3, 2007 did you check to see if it was correct in the database before you echo it out? Maybe I'm blind but I can't really see anything wrong with what you have there (other than a few weird things), perhaps it's a mistake in the way you display the information. Link to comment https://forums.phpfreaks.com/topic/41035-strange-sql-behaviour/#findComment-198719 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.