PDA

View Full Version : Creating simple PHP file to call info


paul41598
09-23-2005, 01:07 PM
This is kinda in response to this thread here that I made:
https://vborg.vbsupport.ru/showthread.php?t=96420

Since I probably cant get someone to create the addon for me, I minus well try the code myself? How do I create a simple query to call info from the table in the database, with the secret admirer info?

So far I have:


require_once('./global.php');



$query= $DB_site->query_first("SELECT userid, admiresuserid, datecreated FROM ".TABLE_PREFIX."secretadmirer");
$num = $DB_site->num_rows($query);


and it doesnt work

Marco van Herwaarden
09-23-2005, 01:27 PM
1. You are not using a WHERE clause? Shouldn't you limit it to row(s) for the current user?
2. Are you expecting 1 row in return or more? If 1, then query_first is ok, otherwise use query combined with a while loop.
3. num_rows() will not work on the return value of a query_first.