The quick answer is that that is what it's supposed to return... that's all
the result is. A nicer, longer answer is to give you some of my code so you
can see one way that you actually get the data out (I use sybase_fetch_row,
but you can also use <db>_fetch_array which returns an associated array or
something - check the manual):
$dataResult = sybase_query($sql);
while ($array_ref = sybase_fetch_row($dataResult)) {
if ($array_ref[4] == 1) {
if ($array_ref[0] == $male ) {
$left[$i] = $array_ref[2];
$names[$i] = $array_ref[3];
$ages[$i] = $array_ref[1];
$i++;
}
elseif ($array_ref[0] == $female ) {
$right[$j] = $array_ref[2];
$j++;
}
}
}//while
Last note - the index of the array ref refers to something in your SQL
starting with 0 (so my sql started with select sex...)
-Natalie
-----Original Message-----
From: Jas [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 1:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] resource id#2 - ????
Not sure how to over come this, the result of a database query keeps giving
me this: <?php
/* Get Ip address, where they came from, and stamp the time */ if
(getenv(HTTP_X_FORWARDED_FOR)){
$ipaddy = getenv(HTTP_X_FORWARDED_FOR);
} else {
$ipaddy = getenv(REMOTE_ADDR); }
$referrer = $HTTP_REFERER;
$date_stamp = date("Y-m-d H:i:s");
/* Start session, and check registered variables */ session_start(); if
(isset($HTTP_SESSION_VARS['ipaddy']) ||
isset($HTTP_SESSION_VARS['referrer']) ||
isset($HTTP_SESSION_VARS['date_stamp'])) {
$main = "Video clips stored in Database";
/* Insert client info to database table */
require('/path/to/connection/class/con.inc');
$table_sessions = "dev_sessions";
$sql_insert = "INSERT INTO $table_sessions
(ipaddy,referrer,date_stamp) VALUES ('$ipaddy','$referrer','$date_stamp')";
$result = @mysql_query($sql_insert,$dbh) or die("Couldn't execute
insert to database!");
/* Pull video info from database table into an array */
$table_content = "dev_videos";
$sql_content = @mysql_query("SELECT * FROM $table_content",$dbh);
while ($row = @mysql_fetch_array($record)) {
$id = $row['id'];
$file_name = $row['file_name'];
$file_size = $row['file_size'];
$file_properties = $row['file_properties'];
$file_codec = $row['file_codec'];
$file_author = $row['file_author'];
$result = @mysql_query($sql_content,$dbh) or die("Couldn't execute
query on database!");
/* loop through records and print results of array into table */
$current .=
"<tr><td>$id</td><td>$file_name</td><td>$file_size</td><td>$file_properties<
/td><td>$file_codec</td><td>$file_author</td></tr>"; }
} else {
/* Start a new session and register variables */
session_start();
session_register('ipaddy');
session_register('referrer');
session_register('date_stamp'); }
?>
Just to make sure everything is working correctly I have echoed every
statement to the screen so I may see what's going on like so: <?php echo
$main; ?> <table width="75%" border="1"> <?php echo $current; ?> // my
results should be here but instead I get Resource ID #2 printed???? wtf?
</table><br> <?php echo $ipaddy; ?><br> <?php echo $referrer; ?><br> <?php
echo $date_stamp; ?><br> <?php echo $sql_insert; ?><br> <?php echo
$sql_content; ?><br> <?php echo $id; ?><br> <?php echo $file_name; ?><br>
<?php echo $file_size; ?><br>
Any help would be great!
Jas
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php