Jump to content

[SOLVED] I have a problem using my UPDATE the right way.


Redlightpacket

Recommended Posts

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());

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.