Help a newbie get started.

A

Anonymous

Guest
You need to do the following steps:

a).Establish a connection with the database server
b).Then, run the sql you have created
c).Pull the results returned and display it

Here is an example:
http://phillipnb.wordpress.com/2010/12/
 
Your code has steps a and b. Now you need to do step c. Here is a sample code:
PHP:
while ($row = mysql_fetch_assoc($myResult)) {
    echo "<br/>".$row["userid"];
    echo "<br/>".$row["firstname"];
    echo "<br/>".$row["lastname"];
    echo "<br/>";
}
 

I do not know what fields your table 'memb_info' has. userid,firstname and lastname are the fields, you need to change them. echo does the display...so, you should now be able to see the data on a web page
 
I am trying to do this with my hosting account cpanel/phpmyadmin so I assume that is what you are talking about in (a).

No, I am talking about what you did at the top of the code,i.e. telling php where your database server is, what user name and password to use to login, the database name ...upto to the line mysql_connect().

The rest, you have already figured that out.
 
Back
Top