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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.