•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 402,933 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,034 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 1983 | Replies: 2 | Solved
![]() |
•
•
Join Date: Sep 2004
Posts: 9
Reputation:
Rep Power: 0
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_query($q,$connect);
Try chaging the query to this
$q="Select authorid from authors where AuthorName='$author'";
Try this
$author=$_POST["authorname"]; echo $author;
Do you get what you expect?
If nothing of this works, then you have a problem in $connect
Cheers
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- 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


Linear Mode