Jump to content

mysql_fetch_array(): supplied argument is not a valid...


mattyd

Recommended Posts

I have searched for this topic here but have not found reference to it.

 

I am receiving the following:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a4542527/public_html/index.php on line 8

 

The scripting for this is basic at this point (I am building something in steps and this is just a test section: The script will call data from the table and display said data.)

 

The following is the code (two, separate files located on my server)- I am hoping that someone may see something that I am missing.

 

connection.php

<?php
    $dbhost = 'mysql7.000webhost.com';
    $dbuser = 'a4542527_root';
    $dbpass = '**********';
    
    $db = 'a4542527_test1';
    $conn = mysql_connect($dbhost,$dbuser,$dbpass);
    mysql_select_db($db);

?>

 

index.php

<?php
    include 'connection.php';
    
    $query = "SELECT * FROM people";
    
    $result = "mysql_query($query)";
    
    while ($person = mysql_fetch_array($result)){
    echo  $person ['name'];
    echo  $person ['descrip'];
    }
?>

 

Thank-you for any help, suggestions or a point in the right direction.

~Matty

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.