Jump to content

not a valid MySQL-Link resource


maxudaskin

Recommended Posts

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/thelyonn/public_html/spilledinkmac/include/functions.php on line 70

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/thelyonn/public_html/spilledinkmac/include/functions.php on line 72

 

 

Any Ideas?

 

function viewpoems($limit){
    $viewpoemsql = "SELECT * FROM entries_literature ORDER BY eid DESC LIMIT 2";
    $viewpoemquery = mysql_query(viewpoemsql,$con);
    echo '<table width="162" border="0" cellspacing="0" cellpadding="0">';
    while($viewpoemresult = mysql_fetch_array($viewpoemquery)){
echo '<tr>';
    echo '<td colspan="2"><div align="center">Title</div></td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td>';
    echo '<div align="left" class="style1">Name</div></td>';
    echo '<td><div align="right" class="style1">Date</div></td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td colspan="2"><div align="center">TEXT</div></td>';
    echo '</tr>';
 }
 echo '</table>';
}

Link to comment
Share on other sites

You need to pass the $con variable into the function or not use the connection argument. PHP will always use the last open connection if one isn't supplied.

This

$viewpoemquery = mysql_query($viewpoemsql,$con);

TO

$viewpoemquery = mysql_query($viewpoemsql);

 

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.