jjacquay712 Posted November 18, 2008 Share Posted November 18, 2008 im trying to make an install script to set up a database. I want to forward them to my index page if they haven't competed the install script. How could i check to see if the user has ran the install script? i was thinking of using a database to hold a boolean value to check to see of the user installed, but if the user didn't install, it would make a mysql zero rows returned error. Any ideas? Link to comment https://forums.phpfreaks.com/topic/133258-solved-php-install-script/ Share on other sites More sharing options...
DarkWater Posted November 18, 2008 Share Posted November 18, 2008 There is no "zero rows returned error" because it's not an error... =/ Link to comment https://forums.phpfreaks.com/topic/133258-solved-php-install-script/#findComment-693063 Share on other sites More sharing options...
jjacquay712 Posted November 18, 2008 Author Share Posted November 18, 2008 ill give you an example: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/johnj/public_html/test.php on line 2 Link to comment https://forums.phpfreaks.com/topic/133258-solved-php-install-script/#findComment-693065 Share on other sites More sharing options...
DarkWater Posted November 18, 2008 Share Posted November 18, 2008 That just means that you either: [*]Used the wrong, non-resource variable in mysql_fetch_*() functions [*]You disconnected from MySQL or some other rare failure like that. [*]You had a bad query. This does NOT mean no rows were returned, it just means you had a syntax error. This is the most common issue. Has nothing to do with 0 rows. Link to comment https://forums.phpfreaks.com/topic/133258-solved-php-install-script/#findComment-693068 Share on other sites More sharing options...
jjacquay712 Posted November 18, 2008 Author Share Posted November 18, 2008 will that error come up if the table doesn't exist? Link to comment https://forums.phpfreaks.com/topic/133258-solved-php-install-script/#findComment-693076 Share on other sites More sharing options...
PFMaBiSmAd Posted November 18, 2008 Share Posted November 18, 2008 will that error come up if the table doesn't exist? It would have taken you about a minute to test this yourself - mysql_error() - Table 'your_database_name.your_table_name' doesn't exist mysql_errno() - 1146 Link to comment https://forums.phpfreaks.com/topic/133258-solved-php-install-script/#findComment-693080 Share on other sites More sharing options...
jjacquay712 Posted November 19, 2008 Author Share Posted November 19, 2008 <?php //Connect mysql_connect("localhost", "*****", "*******"); mysql_select_db("******"); //End Connect $rows = mysql_num_rows(mysql_query("SELECT * FROM cvbxcbxcb")); echo $rows; ?> Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/johnj/public_html/test.php on line 6 it prints that warning when the table doesn't exist Link to comment https://forums.phpfreaks.com/topic/133258-solved-php-install-script/#findComment-693089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.