alright, new problem, no more errors, but there's just nothing...here's the
code:

<?php
  $id = rand(1,2);
  $query = "SELECT name FROM mp3 WHERE songid = '" .$id."'";
  $result = mysql_query($query,$connection);
  while($mp3d = mysql_fetch_array($result))
  {
       $mp3d = mysql_fetch_array($result);
  ?>
  <a href="http://www.fplg.net/stream.php?songid=<?php echo $id;?>"
class="hov1"><?php echo $mp3d["name"];?></a>
  <?php
  }
  ?>
  </td>
 </tr>

and here's what the HTML code looks like from the page when i test it out..
<a href="http://www.fplg.net/stream.php?songid=2"; class="hov1"></a>

what's going on with that...
chris

----- Original Message -----
From: James Bogosian <[EMAIL PROTECTED]>
To: Chris Cocuzzo <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, July 23, 2001 7:25 PM
Subject: RE: [PHP]MySQL error, what's wrong here..


> Try:
>
>   $query = "SELECT songname FROM mp3 WHERE sgid = '" .$id."'";
>
> an SQL query requires you to quote strings.
>
> james
>
> -----Original Message-----
> From: Chris Cocuzzo [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 23, 2001 6:57 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP]MySQL error, what's wrong here..
>
>
> <?php
>   $id = rand(1,2);
>   $query = "SELECT songname FROM mp3 WHERE sgid = " .$id;
>   $result = mysql_query($query,$connection);
>   $mp3d = mysql_fetch_array($result);
>   ?>
>
> the server is telling me line 43(which starts with $mp3d) is not a valid
> mysql result resource. what am i doing wrong??
>
> chris
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to