This is a discussion on necessary or not within the PHP General forums, part of the PHP Programming Forums category; I've always given value to a variable which included the value of another variable in the following way. $thanks = &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I've always given value to a variable which included the value of
another variable in the following way. $thanks = "Thank you, ".$fname." ".$lname." for registering."; In working with MySQL queries I haven't used the concatenation. For example: $query = " INSERT INTO userinfo (fname,lname) VALUES ('$fname','$lname') "; OR $query = " SELECT fname,lname FROM userinfo WHERE userinfoID='$userid' "; My question, would it be more correct or better to write the above in the following way? $query = " INSERT INTO userinfo (fname,lname) VALUES ('".$fname."','".$lname."') "; OR $query = " SELECT fname,lname FROM userinfo WHERE userinfoID='".$userid."' "; Thanks, Pasquale |