mysql array

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
damianfossi
Forum Newbie
Posts: 2
Joined: Mon Jul 28, 2003 4:23 pm

mysql array

Post by damianfossi »

hi there ...

i have on my script in php.....

mysql_connect($server, $db_user, $db_pass) or die ("Database CONNECT Error (line 17)");
$sql = mysql_db_query($database, "SELECT * FROM affiliates WHERE refid = '$ref'");
while($ccbill = mysql_fetch_array($sql)) {

and this on the dinamic banner link ....

<?php echo $ccbill["ccbill"]; ?>


the problem is that the value of the $ccbill allways is equal of the first $ref of the database .... never run to the other fields of the $ccbill ...
mickey
Forum Newbie
Posts: 24
Joined: Thu May 01, 2003 11:14 am
Location: Philippines

Post by mickey »

i am not sure but i am guessing there is something wrong with code/logic, you see...

while($ccbill = mysql_fetch_array($sql)) {
<?php echo $ccbill["ccbill"]; ?>

obviously, with this code, you always get the last row in yuor mysql database, there are mysql function that php has that seeks to the nth row in your mysql table..,

mysql_seek(..)?? forgot the name of the function,
Post Reply