Re: MySQL QUERY Results Not Appearing[Scanned]
| From: | Harlequin | Date: | Fri, 02 Jul 2004 12:55:24 +0000 |
| Subject: | Re: MySQL QUERY Results Not Appearing[Scanned] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189536@lists.php.net to get a copy of this message | ||
Michael
just wanted to thank you through the group for your time.
U R A Star...!
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Michael Egan" <MEgan@3tc.org.uk> wrote in message
news:9926D602EE82FB4FB203E442253043C44AA13B@snip-exch.snipdom.co.uk...
Have a look at the mysql functions in the PHP manual - i.e.
http://uk.php.net/mysql_query
I'm also certain this question has been raised fairly recently on the list.
All mysql_query is going to do is either open up the resource or not. You'll
need to use something else to display the data.
For example:
$sql = "select * from members";
if(!$result = mysql_query($sql))
echo mysql_error();
while($row = mysql_fetch_array($result))
{
echo $row['column_name'];
}
HTH,
Michael Egan
-----Original Message-----
From: Harlequin [mailto:michael.mason@arraspeople.co.uk]
Sent: 30 June 2004 12:42
To: php-general@lists.php.net
Subject: [PHP] MySQL QUERY Results Not Appearing[Scanned]
Hi all...
Despite being able to make a connection to the server and execute a query I
am unable to do this through PHP using the following commands:
echo "<h3>active members should appear here</h3>";
$query = "SELECT * FROM RegisteredMembers";
$result = mysql_query($query) or die ("could not execute query");
echo "$result";
Any ideas...?
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The information contained in this email (and in any attachments sent with
it) is confidential. It is intended for the addressee only. Access to this
email by anyone else is unintended and unauthorized.
If you are not the original addressee, 3tc asks you to please maintain
confidentiality. If you have received this email in error please notify 3tc
immediately by replying to it, then destroy any copies and delete it from
your computer system.
Any use, dissemination, forwarding, printing or copying of this email by
anyone except the addressee in the normal course of his/her business, is
strictly prohibited. 3tc owns the copyright in this email and any document
created by us and assert the right to be identified as the author of it.
Copyright has not been transferred to the addressee.
We protect our systems with Sophos Anti-virus -
www.sophos.com