Jump to content

[SOLVED] mysql_fetch_array error


MasterACE14

Recommended Posts

evening folks,

 

I got a basic news page, and im getting an error with the mysql_fetch_array part of it.

 

heres the code:

<?php // Progress ( like design notes from dragonfable )

// includes
include('variables.php');

$rs = mysql_connect( "localhost", "ace_ACE", "*****" );
$rs = mysql_select_db( "ace_cf" );

// SQL query for all entries in descending order
$sql = "SELECT * FROM `cf_progress` order by time";
$rs = mysql_query( $sql );

// loop through records writing a table for each one
while ( $row = mysql_fetch_array( $rs ) )
{

?>

<div id = "txt">
<center><b><u>Progress</u></b><br></center>

<table border="1" width="375">
<tr>
<td><b><?php echo $row["author"]; ?></b></td>

<?php // workout the date in extended form

$datetime = $row["postdate"];
$year = substr( $datetime, 0, 4 );
$mon = substr( $datetime, 4, 2 );
$day = substr( $datetime, 6, 2 );
$hour = substr( $datetime, 8, 2 );
$min = substr( $datetime, 10, 2 );
$sec = substr( $datetime, 12, 2 );
$orgdate = date("F j, Y",
mktime( $hour, $min, $sec, $mon, $day, $year ) );

?>

<td><b><?php echo $row["postdate"]; ?></b></td>
</tr>


<tr><td colspan="2">
<?php echo $row["text"]; ?>
</td></tr>
</table>
<br>


<?php } ?>
</div>

 

heres the error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ace/public_html/conflictingforces/lib/progress.php on line 14

 

Regards ACE

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.