Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP been a while

Featured Replies

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.

You are missing actually running the query :-)

$popout = mysql_query("SELECT * FROM 'covered_locations'") or die ('Error: '.mysql_error ());

  • 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)

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.