On Thursday 29 November 2001 01:29, Kevin Ruiz wrote:

> I've come across yet another problem.


>         $ci = "select contactid from users where username='$username' and
> password='$password'";
>         $cir = mysql_query($ci)
>             or die("Couldn't execute");
>         $query = "select * from my_contacts where contactid='$cir'";
>         $result = mysql_query($query) or
>              die( mysql_error() );
> When I try to print $cir to see if anything's getting passed I keep getting
> something that reads "resource id #2".


> Does anyone know what this means and how I can work around it.

$cir does NOT contain the actual results of your query. It is only a 
*pointer* to your results. To get at the actual result(s):

  print "<table>\n";
  while ($line = mysql_fetch_array($cir)) {
      print "\t<tr>\n";
      while(list($col_name, $col_value) = each($line)) {
          print "\t\t<td>$col_value</td>\n";
      print "\t</tr>\n";
  print "</table>\n";

Read the manual for full details.

Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

Total strangers need love, too; and I'm stranger than most.

PHP Database 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