homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

PHP to pull from sql

 2:02 pm on Apr 3, 2002 (gmt 0)


I have recently started learning PHP/SQL techniques.

I am a complete beginner and have recently been on a 3day 1-2-1 course to learn the basics. However, i am having trouble and hope somone can help.

I am basically just trying to pull information from my database. I have a local server on my PC.

I have typed this code within my HTML document:

$db = mysql_connect("localhost","Administrator","password");

here are the results:

$result = mysql_query("SELECT firstname FROM brian");

I know the database does work, cause by sheer fluke i got some results up earlier. but didn't save!!! doh!!!

Can someone please tell me how to pull the information ffrom my database please.





 2:10 pm on Apr 3, 2002 (gmt 0)

Welcome to WebmasterWorld webboy1,

while ($row = mysql_fetch_array($result)) {
print "I have a row $row[firstname]";

Will get you started, another useful function
$num = mysql_num_rows($result);

And even more useful,

[php.net...] -- will make you an expert in no time ;) .... good luck.


 2:17 pm on Apr 3, 2002 (gmt 0)

thanks gethan.

Now i know i definetly have everythng setup correctly cause that code example worked. I was beggining to think i was going mad, when instead it is just rusty PHP skills!!!

thanks man!!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved