If statement
| From: | Website4S at aol dot com | Date: | Wed, 18 Oct 2000 17:37:07 +0000 |
| Subject: | If statement | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-20939@lists.php.net to get a copy of this message | ||
Hi,
Firstly thanks to the people who replied to my "Calling text files" I managed
to get the text file up using one of the tutorials you sent me to.
Now that I have that working I wonder if any of you know of a good if
statement tutorial or if any of you know the code I could use in the
following...
.....
$Selstmt="Select ProfileID from Member";
$dbh=mysql_connect($host, $user, $passwd);
$query=mysql_db_query($dbase, $Selstmt);
$num_rows=mysql_num_rows($query);
mysql_close();
$file_name = "noprofile.txt";
$file_pointer = fopen($file_name, "r");
$file_read = fread($file_pointer, filesize($file_name));
fclose($file_pointer);
print "$file_read";
?>
I have the ProfileID set as an int(10) in the table, when a member joins up
the details are entered into the table and ProfileID is set at 0, I need an
if statement which will only show the text file if the ProfileID is set at
zero, if it is set at any other number then nothing will be shown. I know it
has something to do with $num_rows but that is as much as I have found out so
far, anyone have the code or a good tutorial.
Cheers
Ade