
PHP questions
Started by SpleenBeGone, May 31 2012 09:12 AM
8 replies to this topic
#1
Posted 31 May 2012 - 09:12 AM
I have a database in sql with a good bit of information. I want a page that shows the name and date columns, and then onclick brings to a page that shows the full information of that row. Suggestions?

#2
Posted 31 May 2012 - 09:17 AM
Get baals happy ass over here
#3
Posted 31 May 2012 - 10:04 AM

Just make him write it for me? >.>

#4
Posted 31 May 2012 - 12:41 PM
You know he could
and all it takes is a carton of smokes >.>
and all it takes is a carton of smokes >.>
#5
Posted 13 June 2012 - 06:07 AM
cigarettes!?!?
#6
Posted 13 June 2012 - 06:21 AM
What exactly do you need help with? PHP's SQL functions?
$col = mysql_query(select * from COLUMN);
$data = mysql_fetch_array($col);
echo $data['someAttribute'];
Use a while loop to iterate over each row:
while ($data = mysql_fetch_array($col)){
echo $data['someAttribute'];
}
Where "someAttribute" is an attribute of the column specified in the mysql_query.
edit: and of course this is after establishing a connection to the db in the first place.
$col = mysql_query(select * from COLUMN);
$data = mysql_fetch_array($col);
echo $data['someAttribute'];
Use a while loop to iterate over each row:
while ($data = mysql_fetch_array($col)){
echo $data['someAttribute'];
}
Where "someAttribute" is an attribute of the column specified in the mysql_query.
edit: and of course this is after establishing a connection to the db in the first place.
#7
Posted 13 June 2012 - 07:57 AM
Pretty much everything after connecting to the database. I originally mananged to paginate each row, and have the proper information, but the volume has increased drastically and that's no longer an easy to use solution.

#9
Posted 24 July 2012 - 06:48 AM
This is kind of my specialty. What exactly do you want your output page to look like? Do you just want a giant table of all the information or would you like to be able to view pages of certain amounts at a time? It's fairly simple to limit the SQL query to just the name and date, and then only query that row for the additional information.
You also said you want to see things on-click, I presume you mean without having to reload the page, you want a popup or something with the information for that row? That can be done fairly easily with an ajax object.
Answer the above and I can whip up an example today for you.
EDIT: Just realized this was posted months ago. Lololol
You also said you want to see things on-click, I presume you mean without having to reload the page, you want a popup or something with the information for that row? That can be done fairly easily with an ajax object.
Answer the above and I can whip up an example today for you.
EDIT: Just realized this was posted months ago. Lololol
Edited by K_N, 24 July 2012 - 06:48 AM.
Rumors of my demise have been greatly exaggerated.