W
WYSIWYG
Guest
Hi. in php i have the below code:
$results = mysql_query
("select user from lecturer where user =
'$_POST[user]'");
This i believe puts a list of results in the $results record set. Now... i am doing this so that a list will be produced in the record sec that has the same name as the variable $_POST[user] which is from a form. I am doing this to check if the user name given by the form is availible. If the record set is empty the name given by the form can not be in use.
The part of code i am not sure about is next. I have:
if ($row_results == 0) {mysql_query("INSERT INTO........
Its specifically the if ($row_results == 0) part i am unsure about. I beleive it means if the number of rows in the record set is equal to 0 do the following thing.... is this true for what it means? If it does not mean this what do i have to add or change to make it do this. Thanks.
$results = mysql_query
("select user from lecturer where user =
'$_POST[user]'");
This i believe puts a list of results in the $results record set. Now... i am doing this so that a list will be produced in the record sec that has the same name as the variable $_POST[user] which is from a form. I am doing this to check if the user name given by the form is availible. If the record set is empty the name given by the form can not be in use.
The part of code i am not sure about is next. I have:
if ($row_results == 0) {mysql_query("INSERT INTO........
Its specifically the if ($row_results == 0) part i am unsure about. I beleive it means if the number of rows in the record set is equal to 0 do the following thing.... is this true for what it means? If it does not mean this what do i have to add or change to make it do this. Thanks.