Skip to main content
GameDev.net gamedev.net
🔒 Locked

[web] Need Help! (mysql, PHP)

Started by EXER May 25, 2009 at 3:38 PM 2 replies 850+ views
Original Post
EXER
EXER
I know how to create tables, read tables, write to and edit tables in PHP but I only know how to display the whole table. Can anyone tell me how to access one row? Also can I make a page field and display only on page on that page e.g. a PHP variable "page = home;" and have only the rows with "home" display? thanks.
Stani R
Stani R
Using mysql_fetch_alloc, it seems. Row by row.

For the second question, I'm a bit lost as to what exactly you want to do. Fetch a whole html page from your database? If you want to restrict the result set, the best time to do that is usually when constructing your SQL query.
VerMan
VerMan
yes, I understand your second question as follows:

field1 - field2 - ... - fieldn - page xx       xx              xx     "home" yy       yy              yy     "intro"...


So you have to set the page from within your query, so you only display those rows that belong to the page "home" or "intro" or whatever.

Wan
Wan
SELECT * FROM [table name] WHERE page = 'home'

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.