Jump to content

New to MySQL - Day 2


spoco

Recommended Posts

I was able to get a page to write to a database, now I'm trying to get a page that will display all of the records. Why is this code not working?

<?php require_once("../databaseconn.php"); ?>

<?php
mysql_select_db('training', $databaseconn);

$SQLstring = "SELECT * FROM evaluation";
$QueryResult = mysql_query($SQLstring, $databaseconn) or die(mysql_error(Unable to execute query.));
$Row = mysql_fetch_row ($QueryResult);

echo "<p><strong>1a</strong>" {$Row[0}}<br />";
echo "<strong>1b</strong>" {$Row[1}}<br />";
echo "<strong>1c</strong>" {$Row[2}}<br />";
echo "<strong>2a</strong>" {$Row[3}}<br /></p>";
?>
</div></p>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/133225-new-to-mysql-day-2/
Share on other sites

Okay. fixed that, but still no results. blank page.

 

<?php require_once("../databaseconn.php"); ?>

<?php
mysql_select_db('training', $databaseconn);

$SQLstring = "SELECT * FROM evaluation";
$QueryResult = mysql_query($SQLstring, $databaseconn) or die(mysql_error(Unable to execute query.));
$Row = mysql_fetch_row ($QueryResult);

echo "<p><strong>1a</strong>: {$Row[0}}<br />";
echo "<strong>1b</strong>: {$Row[1}}<br />";
echo "<strong>1c</strong>: {$Row[2}}<br />";
echo "<strong>2a</strong>: {$Row[3}}<br /></p>";
?>
</div></p>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/133225-new-to-mysql-day-2/#findComment-692885
Share on other sites

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.