Redlightpacket Posted May 5, 2009 Share Posted May 5, 2009 I need some help trying to get my UPDATE to work the right way for this particular piece of code. I am really confused here. $array = array('p', $user); $com = join("", $array); //test me echo $com; $query = "CREATE TABLE IF NOT EXISTS $com(id SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY, bio VARCHAR(450), idea VARCHAR(450), location VARCHAR(50))"; $table1 = mysql_query($query) or die("Query failed: ".mysql_error()); //$query = "UPDATE $com SET idea = $idea, bio = $bio, location = $location, WHERE id = "1""; //Here is my update statement, when I run the script, it says there is an error in this line. $result = mysql_query("UPDATE $com SET bio = '$bio', idea = '$idea' location = '$location' WHERE id = '1'") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/156933-solved-i-have-a-problem-using-my-update-the-right-way/ Share on other sites More sharing options...
Redlightpacket Posted May 5, 2009 Author Share Posted May 5, 2009 I figured it out, but thanks for the time to look at my post. Quote Link to comment https://forums.phpfreaks.com/topic/156933-solved-i-have-a-problem-using-my-update-the-right-way/#findComment-826706 Share on other sites More sharing options...
Maq Posted May 5, 2009 Share Posted May 5, 2009 Please share. Also, you should mark as SOLVED if that's the case. Quote Link to comment https://forums.phpfreaks.com/topic/156933-solved-i-have-a-problem-using-my-update-the-right-way/#findComment-826713 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.