Hi
Im new to programming but i have been able to create a table and to set up a successful login script. However, i want to echo a select query and no matter what i try i fail. Any help appreciated. This is with mysql. Thanks.
Hammer
echo select query
Moderator: General Moderators
-
nickvd
- DevNet Resident
- Posts: 1027
- Joined: Thu Mar 10, 2005 5:27 pm
- Location: Southern Ontario
- Contact:
The way I do it (when I'm not using my db class) is as follows
that way, if you ever need to see what the query was, it's as simple as
very useful if you are building a query using variables, or a loop, etc...
my db class has built-in query debugging that echo's the query if i want it too (using the same method as above)
Code: Select all
$query = "SELECT * FROM `table` WHERE field = 'value'";
mysql_query ($query);Code: Select all
echo $query;my db class has built-in query debugging that echo's the query if i want it too (using the same method as above)
Code: Select all
$query ="SELECT ..."
$result = mysql_query ($query);
$row = mysql_fetch_array($result);