![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||
|
Professional Programmer
Join Date: May 2006
Location: UK - London
Posts: 327
Rep Power: 3
![]() |
MYSQL output help
Quote:
__________________
Quote:
|
||
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8
![]() |
[php]$result=mysql_query("select event from events")||die("error querying db");
$row = mysql_fetch_row($result); echo $row[0];[/php] Enjoy. ![]() |
|
|
|
|
|
#3 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 742
Rep Power: 3
![]() |
$result is not an array. It is a MySQL resource, assuming the query was successful (if it wasn't, you'd get the call to die()). After the call to mysql_fetch_array(), $cont should be an array containing something to the likes of Array("event" => /*whatever an event would be*/). You can call mysql_fetch_array($result) as many times as rows were returned from the query (mysql_num_rows($result)).
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Change the name of output file | jazz | C | 4 | Jun 28th, 2006 2:54 AM |
| MySQL with python? | snipertomcat | Python | 2 | Apr 13th, 2006 1:34 AM |
| Numerical data output to a file | can342man | C++ | 4 | Jan 27th, 2006 4:21 PM |
| Tutorial - Using MySQL in C# | Darkhack | C# | 12 | Jan 17th, 2006 9:28 AM |
| It's giving me "Press any key to continue" and no other output.. | Insomniac | C | 15 | Jun 5th, 2005 7:07 AM |