Jump to content

undifined error in php


Porkie

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.

Archived

This topic is now archived and is closed to further replies.

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