Jump to content

Question about mysql_fetch....


Gruzin

Recommended Posts

Thanks Huggie,

I will read the manual again...

Actaually I have a simple mysql query, like this:
[code]$sql = mysql_query("SELECT * FROM aid_poll_results WHERE id='17'");
while($row = mysql_fetch_assoc($sql)){
$opt1 = $row['1'];
$opt2 = $row['2'];
$opt3 = $row['3'];
$opt4 = $row['4'];
$opt5 = $row['5'];
$opt6 = $row['6'];
$opt7 = $row['7'];
$opt8 = $row['8'];
$opt9 = $row['9'];
}[/code]

above query fetches rows correctly, but this:
[code]$sql = mysql_query("SELECT * FROM aid_poll_results WHERE id='17'");
while($row = mysql_fetch_array($sql)){
$opt1 = $row['1'];
$opt2 = $row['2'];
$opt3 = $row['3'];
$opt4 = $row['4'];
$opt5 = $row['5'];
$opt6 = $row['6'];
$opt7 = $row['7'];
$opt8 = $row['8'];
$opt9 = $row['9'];
}[/code]

this example fetches rows, omitting 1 row, I mean it does fetch the rows except firts one, and instead of it fetches id row... hope u understand me :)

Thanks,
George
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.