XpertWorlock Posted September 8, 2008 Share Posted September 8, 2008 The script creates a file, although when it creates it. the variable changes in the newly created file. $row = (mysql_fetch_array($result)); when the file is created, the below is the only thing that shows up. = (mysql_fetch_array()); what could cause this? it goes for all variables in the code, if you need the whole thing, it is below. $Content = (" <?php include 'siteLayout.php'; dbConnect(); $result = mysql_query('SELECT * FROM users WHERE userName == '$signUpName' '); $row = (mysql_fetch_array($result)); if(mysql_num_rows($result)==0){ echo 'No results'; }; mysql_query('INSERT INTO users (userName, userPassword, userEmail) VALUES ('$signUpName', '$signUpPassword', '$signUpEmail')'); echo '<table border='1'><tr><td> Your account has been activated.<br><br>Please log in. </td></tr></table>'; ?> \r\n"); $handle = fopen($fileName, 'x+'); fwrite($handle, $Content); fclose($handle); Link to comment https://forums.phpfreaks.com/topic/123196-variables-disappear-entirely/ Share on other sites More sharing options...
dezkit Posted September 8, 2008 Share Posted September 8, 2008 Is that really your code? Link to comment https://forums.phpfreaks.com/topic/123196-variables-disappear-entirely/#findComment-636277 Share on other sites More sharing options...
XpertWorlock Posted September 8, 2008 Author Share Posted September 8, 2008 yes, it's a piece of script in a php file that creates another php file (it's isn't the full file, because the rest of the file runs right) dbConnect() creates the connection to the MYSQL database Link to comment https://forums.phpfreaks.com/topic/123196-variables-disappear-entirely/#findComment-636282 Share on other sites More sharing options...
unrelenting Posted September 8, 2008 Share Posted September 8, 2008 Try: $row = mysql_fetch_array($result); Link to comment https://forums.phpfreaks.com/topic/123196-variables-disappear-entirely/#findComment-636285 Share on other sites More sharing options...
XpertWorlock Posted September 8, 2008 Author Share Posted September 8, 2008 nah it didn't work, I had it like that before and that's why I switched it to this, but I had to try again. It confuses me. Link to comment https://forums.phpfreaks.com/topic/123196-variables-disappear-entirely/#findComment-636291 Share on other sites More sharing options...
unrelenting Posted September 8, 2008 Share Posted September 8, 2008 You also don't need the semi-colon after this line: if(mysql_num_rows($result)==0){ echo 'No results'; }; Link to comment https://forums.phpfreaks.com/topic/123196-variables-disappear-entirely/#findComment-636294 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.