Jump to content

Display SQL Query results


slj90

Recommended Posts

I have a SQL code that works when I run it through phpmyadmin but I can't get PHP to display the results on a page.

 

Here is my attempt:

 

<?php


require 'connect.php';

$query = "SELECT * FROM table003 WHERE status='pending' ORDER BY id ASC LIMIT 1";
$result = mysql_query($query);

$row = mysql_fetch_row($result);

echo $row[1]; 
echo $row[2];

?>
 
It displays nothing.
 
Thanks
 
 
---
 
Update:
I got it working now and edited the code in this forum.
Link to comment
https://forums.phpfreaks.com/topic/285983-display-sql-query-results/
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.