Jump to content

Recommended Posts

hey i seem to get an error basically saying that it cannot find the data but im very confused because all its doing is loading the data from a database. Can someone please clarify where iam going wrong.

 

http://www.getrecognized.co.uk/rss_show.php

 

<?php
{
ini_set ("display_errors", "1"); error_reporting(E_ALL);
require('core.inc.php');
echo page_header();
}
    
$con = mysql_connect("");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("", $con);

$q ="SELECT * FROM news ";
$sql5 = mysql_query($q);
$rsstitle = $row['rsstitle'];
echo '<table><tr>';
echo '<td>';
echo 'RSS Feed';
echo '</td>';
echo '</tr>';
while ($row = mysql_fetch_assoc($sql5)) {
    echo '<tr>';
    echo '<td>';
    echo $row['$rsstitle'];
    echo '</td>';
echo '</tr>';
    echo '<tr>';
    echo '<td>';
    echo $row['rssdescription'];
    echo '</td></tr>';
    echo '<tr>';
    echo '<td>';
    echo $row['rsslink']; 
    echo '</td></tr>';
    echo '</table>';
    }

?>

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/170409-undifined-error-in-php/
Share on other sites

Please don't use:

 

if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

 

Imagine you being the clueless visitor who visits your website at the time your SQL server kicks it and sees:

 

Could not connect: Can't connect to MySQL server on 'localhost' (2003)

 

Instead log these and display a nice error message to your visitor that you are having some technical difficulties.

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.