Hi,
I have been using phpmyadmin to mess around with my database (I'm at chapter 4 of Kevin Yanks db book...)
I have successfully connected to the MySQL server;
I then ran this, to locate my db...PHP Code:<?php
// Connect to the database server
$dbcnx = @mysql_connect('207.44.142.94', 'root', '******');
if (!dbcnx)
{
echo( '<p>Unable to connect to the ' .
'database server at this time.</p>' );
}
else
{
echo( 'connected!!' );
exit();
}
?>
It returns;PHP Code:<?php
// Connect to the database server
$dbcnx = @mysql_connect('207.44.142.94', 'root', '******');
if (!dbcnx)
{
die( '<p>Unable to connect to the ' .
'database server at this time.</p>' );
}
// Select the database
if (! @mysql_select_db('nedesign') )
{
die( '<p>Unable to locate the nedesign ' .
'database at this time.</p>' );
}
?>
<p>Here are all the jokes in the database: </p>
<blockquote>
<?php
// Request the text in all the jokes
$result = @mysql_query('SELECT joketext FROM jokes');
if (!$result)
{
die('<p>Error performing query: ' . mysql_error() .
'</p>');
}
// Display the text of each joke in paragraph
while ( $row = mysql_fetch_array($result) )
{
echo('<p>'. $row['joketext'] . '</p>');
}
?>
'Unable to locate the nedesign database at this time'
Though, as I mentioned - I've been using the nedesign db - I added a jokes table using phpmyadmin...??
Very confusedly yours,
Nick




Bookmarks