I think i need UPDATE SYNTAX not sure.. read for deital
Moderator: General Moderators
I think i need UPDATE SYNTAX not sure.. read for deital
Ok, in my site theres a profile thing, like in these boards edit your profile. It's simple right now since im new to php, but i tried using a code to make it so they can update thier profile. Instead it inserets the info they submit into a new row in my table. Do i need to use update? If so how?
If you are using MySQL try reading documentation on http://www.mysql.org first, it's the best thing to do.
Dosn't update look something like
I think thats it, but don't know how to set it up to use it in my case, which is making a profile setup. I know the html session_register ect but not the update. I think i know what goes in column not value though.
Code: Select all
<? UPDATE table_name SET column1=value1, column2=value2, ..., columnN=valueN їWHERE feild=value] ?>їquote="I3lade"]Yeah i tried that, its kinda confusing, its easier when u ask someone see a example of code or something to me, is there anyone who can help with update if i even need that?ї/quote]
Yes it is easier, but it is wiser to do it by yourself. You will learn faster, and you'll have more pleasure when you achieve something, but....
If you want to update the database table you must use something like this:
їcode]
// for mysql
$bp = mysql_connect("localhost","login","password");
mysql_select_db("database",$bp);
mysql_query("UPDATE sth SET sth=sth, asdf=asdf, asdf=asdf,....",$bp);
ї/code]
But that's VERY simple example and HELL out of a good php script.
Yes it is easier, but it is wiser to do it by yourself. You will learn faster, and you'll have more pleasure when you achieve something, but....
If you want to update the database table you must use something like this:
їcode]
// for mysql
$bp = mysql_connect("localhost","login","password");
mysql_select_db("database",$bp);
mysql_query("UPDATE sth SET sth=sth, asdf=asdf, asdf=asdf,....",$bp);
ї/code]
But that's VERY simple example and HELL out of a good php script.
So something like:
One thing i dont get... whats the $bp for?
Code: Select all
$bp = mysql_connect("localhost","bladegames","****");
mysql_select_db("bladegames,$bp);
mysql_query("UPDATE members SET profile=user, phob=user, $bp);See mysql_query descirption in php manual.I3lade wrote:So something like:One thing i dont get... whats the $bp for?Code: Select all
$bp = mysql_connect("localhost","bladegames","****"); mysql_select_db("bladegames,$bp); mysql_query("UPDATE members SET profile=user, phob=user, $bp);
-------------------
Of course the code would look something like this:
Code: Select all
$bp = mysql_connect("localhost","bladegames","****");
mysql_select_db("bladegames",$bp);
mysql_query("UPDATE members SET profile=user, phob=user WHERE here_you_descibe_what_record_has_to_be_updated", $bp);