| | |
Single cell query!
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Sep 2004
Posts: 9
Reputation:
Solved Threads: 0
How can i display result of a single cell query?
my query is
my query is
$author=$_POST["authorname"];
$q="Select authorid from authors where AuthorName=$author";
$resultauthor=mysql_query($q,$connect);
$num=mysql_num_fields($resultauthor); <<Error coming here! :( mysql_num_fields(): supplied argument is not a valid MySQL result resource in The error is here
Try chaging the query to this
Probably its because of the missing '' or simply, you´re not getting the POST variable authorname
Try this
Do you get what you expect?
If nothing of this works, then you have a problem in $connect
Cheers
MySQL Syntax (Toggle Plain Text)
mysql_query($q,$connect);
Try chaging the query to this
MySQL Syntax (Toggle Plain Text)
$q="Select authorid from authors where AuthorName='$author'";
Try this
MySQL Syntax (Toggle Plain Text)
$author=$_POST["authorname"]; echo $author;
Do you get what you expect?
If nothing of this works, then you have a problem in $connect
Cheers
![]() |
Similar Threads
- retrieving a single cell of data from a MySQL database (PHP)
- Returning HTML code through SQL query? (PHP)
- Database Query Help (MS SQL)
- Good Luck w/This one: Excel Question VBA/Macro/other (MS Access and FileMaker Pro)
Other Threads in the MySQL Forum
- Previous Thread: Find table size
- Next Thread: Copy tables from one MySql DB to another MySql DB
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery news open-xchange opendatabasealliance opengovernment opensource oracle penelope php priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





