August 23, 201214 yr ok so its been a while since i have done any php, but now im required to and something isnt right on a simple retrieve script. i am getting this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in/home/fhlinux129/a/arporter.co.uk/user/htdocs/learnphp/Includes/right_side.phpon line 5 line 5 is on this code while($row = mysql_fetch_array($popout)) { <? $popout = ("SELECT * FROM 'covered_locations'") or die ('Error: '.mysql_error ()); while($row = mysql_fetch_array($popout)) { ?> <div id="<?=$row['dialog_id']?>" class="window"> <div class="popout_head"><h1><?=$row['title']?><a href="#" class="close">x</h1></a></div> <div class="popout_text"> <p><strong><?=$row['sub_title']?></strong></p> <p><?=$row['content']?></p></div></div> <? }; ?> The database connection is included within the header of the site.
August 23, 201214 yr You are missing actually running the query :-) $popout = mysql_query("SELECT * FROM 'covered_locations'") or die ('Error: '.mysql_error ());
August 23, 201214 yr Author with that im getting Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in/home/fhlinux129/a/arporter.co.uk/user/htdocs/learnphp/Includes/right_side.phpon line 4 Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
August 23, 201214 yr with that im getting Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in/home/fhlinux129/a/arporter.co.uk/user/htdocs/learnphp/Includes/right_side.phpon line 4 Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) try including ur mysql connection link identifier mysql_query("query",$connection); but u really should be using the mysqli set of functions or PDO instead
Create an account or sign in to comment