Hi All,
I am using the following code to pull data from a mySQL database:
[tt]$q = "SELECT * FROM $table";
$result = (Query $dbh_mysql $q || die "Select failed \n
($Mysql::db_errstr)\n"
;
print "$result<br>\n";[/tt]
and it outputs the string:
Mysql::Statement=HASH(0x101826a4)
to the screen (web page). But this is not the information in the database. I want to get some specific information! How do I get this? I really want to select specific information like this:
[tt]$q = "SELECT * FROM $table WHERE (uniq_id = $id)";
$result = (Query $dbh_mysql $q || die "Select failed \n
($Mysql::db_errstr)\n"
;
$num_rows=$result->uniq_id; #Script seems to crash here
print "$num_rows<br>\n";[/tt]
but the script seems to crash at the point indicated. I know the database is there and I can insert data into it so connection is fine but does anyone know how I can get data out of it!
Thanks.
fortytwo
will@hellacool.co.uk
I am using the following code to pull data from a mySQL database:
[tt]$q = "SELECT * FROM $table";
$result = (Query $dbh_mysql $q || die "Select failed \n
($Mysql::db_errstr)\n"
print "$result<br>\n";[/tt]
and it outputs the string:
Mysql::Statement=HASH(0x101826a4)
to the screen (web page). But this is not the information in the database. I want to get some specific information! How do I get this? I really want to select specific information like this:
[tt]$q = "SELECT * FROM $table WHERE (uniq_id = $id)";
$result = (Query $dbh_mysql $q || die "Select failed \n
($Mysql::db_errstr)\n"
$num_rows=$result->uniq_id; #Script seems to crash here
print "$num_rows<br>\n";[/tt]
but the script seems to crash at the point indicated. I know the database is there and I can insert data into it so connection is fine but does anyone know how I can get data out of it!
Thanks.
fortytwo
will@hellacool.co.uk