Jump to content

djcontact

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

djcontact's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok so i added the error checking for the mysql statement but im still getting the same error, [b]Warning:[/b] mysql_fetch_array(): 20 is not a valid MySQL result resource in [b]/home/nelsona/public_html/index.php[/b] on line [b]9[/b] [b]Warning:[/b] mysql_free_result(): 20 is not a valid MySQL result resource in [b]/home/nelsona/public_html/index.php[/b] on line [b]17[/b] i really appricate the help thanks
  2. this is what i have on my connection.php [code] #database access info define ('DB_USER', 'myuser'); define ('DB_PASS', 'mypass'); define ('DB_HOST', 'localhost'); define ('DB_NAME', 'mydbname'); #database connection $dbc = mysql_connect (DB_HOST, DB_USER, DB_PASS) OR die ('Could not connect to mysql: ' .mysql_error() ); mysql_select_db (DB_NAME) OR die ('Could not select database: ' .mysql_error() ); [/code] and this is my index.php [code]include ('_include/connect.php'); //make query $query = "SELECT * FROM layout"; //run the query $result = @mysql_query ($query); if ($result) {     //fetch     while ($row = mysql_fetch_array($result, MYSQL_NUM)) {         if($row[0] == 1) {             include ('layout_01.php');         }         if($row[0] == 2) {             include ('layout_02.php');         }     }     mysql_free_result ($result); //free up the resources } else { //if it did not run ok     echo '<p>The content could not be displayed due to system error!</p>'; } [/code]
  3. so i read that thread you suggested [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=95376\" target=\"_blank\"]Invalid Resource, MySQL[/a] and it doesnt really answer my question... either that or im just not understanding it... i also went ahead and did a search for mysql_fetch_array and i did get a hand full of search results but nothing that i can relate too... well with the amount of php knowledege that i know which is not much, i would love to get some assistants on this. thanks again djcontact
  4. ok some im getting these error: [b]Warning:[/b] mysql_fetch_array(): 20 is not a valid MySQL result resource in [b]/home/nelsona/public_html/index.php[/b] on line 9 [b]Warning:[/b] mysql_free_result(): 20 is not a valid MySQL result resource in [b]/home/nelsona/public_html/index.php[/b] on line 17 any idea why im perhaps getting this error... i first did this site on my server and had no problems, then transfered it over to the clients server and now im getting this error. any help would be appricated thanks djcontact
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.