vcherubini
Programmer
Hello:
I have a question on how to retrieve data from a mysql dbase.
I can input data into a database, with the following code:
[tt]
$result = mysql("test", "INSERT INTO links (link1, link2, link3, link4)
VALUES ('$link1', '$link2', '$link3', '$link4')"
;
[/tt]
Where all of the variables would be the names of text fields from a previous page.
The problem I have is how do I retrieve the data from the same dbase?
I try something like this:
[tt]
$result = mysql_query("SELECT * FROM (links)"
;
if (!$result) {
print "failed to perform query\n";
print mysql_error();
} else {
print "$result<br>\n";
}
[/tt]
All that I get is something that says "Resource Id#3".
I want it to print the data within the field.
Any help is appreciated. Thank you.
-Vic
vic cherubini
malice365@hotmail.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
Wants to Know: Java, Cold Fusion, Tcl/TK
====
I have a question on how to retrieve data from a mysql dbase.
I can input data into a database, with the following code:
[tt]
$result = mysql("test", "INSERT INTO links (link1, link2, link3, link4)
VALUES ('$link1', '$link2', '$link3', '$link4')"
[/tt]
Where all of the variables would be the names of text fields from a previous page.
The problem I have is how do I retrieve the data from the same dbase?
I try something like this:
[tt]
$result = mysql_query("SELECT * FROM (links)"
if (!$result) {
print "failed to perform query\n";
print mysql_error();
} else {
print "$result<br>\n";
}
[/tt]
All that I get is something that says "Resource Id#3".
I want it to print the data within the field.
Any help is appreciated. Thank you.
-Vic
vic cherubini
malice365@hotmail.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
Wants to Know: Java, Cold Fusion, Tcl/TK
====