Jump to content

Coding help


RON_ron

Recommended Posts

I'm unable to update the table. Could someone tell me why?

 

$dfield1 = mysql_real_escape_string($field1);
$dfield2 = mysql_real_escape_string($field2);
$dfield3 = mysql_real_escape_string($field3);
$dfield4 = mysql_real_escape_string($field4);

$result =sprintf("SELECT * FROM db1 WHERE username ='%s'", $dfield1);
$resultf = mysql_query($result);
if (mysql_num_rows ($resultf) > 0){
$register = "&err=Not Available. Retry.";
echo($register);
} else {

mysql_query("INSERT INTO db1 (name, birthday, street, phone) VALUES ('$dfield1', '$dfield2', '$dfield3', '$dfield4')");
$register = "Successful.";
echo($register);
}

Link to comment
Share on other sites

You seriously need to learn some debugging and manual reading skills. Your posting lots of questions and learning nothing from the answers.

 

On top of that you really should learn some communication skills. You have not provided anywhere near enough information for anyone to be able to assist you. You are seriously verging on trolling.

Link to comment
Share on other sites

You seriously need to learn some debugging and manual reading skills

Accepted.

 

and learning nothing from the answers.

What are you referring to?

 

You have not provided anywhere near enough information

My question was "I'm unable to update the table. Could someone tell me why?"

Basically when i use this code it doesn't update the mysql db.

 

in addition.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_VARIABLE or '$' in /home/.../test.php on line 5

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.