Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

count

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
superman
Smarty Rookie


Joined: 08 Jul 2003
Posts: 11

PostPosted: Tue Jul 22, 2003 1:43 pm    Post subject: count Reply with quote

is this code correct? but i got this error message 'Resource id #2'


<?
$Connect = mysql_connect("localhost","root","");
mysql_select_db("mw");
$result=mysql_query("select count(StaffID) from LeaveApplication1 where StaffID = 'fui'") ;
echo "$result";
mysql_close();
?>
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Jul 22, 2003 3:26 pm    Post subject: Reply with quote

the code is correct and the return-value is also correct. but this is absolutely not smarty related (read: off-topic).

maybe you want to read: http://www.php.net/manual/en/function.mysql-fetch-row.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Jul 22, 2003 6:51 pm    Post subject: Reply with quote

@messju: YES, the above does correctly printout the fact that mysql driver returns a RESOURCE, but if that's what was desired, we probably wouldn't have heard about it.

I don't think it is correct in that he probably wants to read the CONTENTS of $result using one of the mysql_* functions (as you suggested).

@superman: Anyhow, its still not Smarty but I suggest you read AT LEAST the PHP man page for MySQL.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP