Jump to content

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

You should enable error reporting. I can see at least one place that should give you a warning.

 

To enable error reporting add these two lines at the beginning of your script

 

ini_set("display_errors","1");
error_reporting(E_ALL);

 

 

Link to comment
https://forums.phpfreaks.com/topic/133225-new-to-mysql-day-2/#findComment-692905
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.