Jump to content

Photo

PHP questions


  • Please log in to reply
8 replies to this topic

#1 SpleenBeGone

SpleenBeGone

    Deer Leader of the Goriest Revolution

  • Administrators
  • 14,951 posts
  • LocationHouston

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?
nmjUGDL.jpg

#2 Wolf

Wolf

    Zettabyte

  • Members
  • 6,487 posts

Posted 31 May 2012 - 09:17 AM

Get baals happy ass over here

#3 SpleenBeGone

SpleenBeGone

    Deer Leader of the Goriest Revolution

  • Administrators
  • 14,951 posts
  • LocationHouston

Posted 31 May 2012 - 10:04 AM

:lol:
Just make him write it for me? >.>
nmjUGDL.jpg

#4 Wolf

Wolf

    Zettabyte

  • Members
  • 6,487 posts

Posted 31 May 2012 - 12:41 PM

You know he could

and all it takes is a carton of smokes >.>

#5 aperture

aperture

    Byte

  • Members
  • 12 posts

Posted 13 June 2012 - 06:07 AM

cigarettes!?!?

#6 aperture

aperture

    Byte

  • Members
  • 12 posts

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.

#7 SpleenBeGone

SpleenBeGone

    Deer Leader of the Goriest Revolution

  • Administrators
  • 14,951 posts
  • LocationHouston

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.
nmjUGDL.jpg

#8 Wolf

Wolf

    Zettabyte

  • Members
  • 6,487 posts

Posted 13 June 2012 - 08:39 AM

Stack Exchange

#9 K_N

K_N

    Megabyte

  • Members
  • 576 posts
  • LocationPhoenix

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

Edited by K_N, 24 July 2012 - 06:48 AM.

Rumors of my demise have been greatly exaggerated.