Anyone, please help me here. I created a view in mysql but when I use it in my code in php, an error appears that the view doesn't exist. What can I do?

Here is my code.

$count = mysql_query("SELECT COUNT(*) FROM ViewName where ftTimeIn != '' AND ftTimeOut != '' AND fdDate like '$date' AND fcShiftCode like '$shift' AND fcDivDesc like '$division'")or die(mysql_error());
$manpower_no = mysql_result($count,0,0);

Thanks.

Recommended Answers

First check whether the view is really available in the database by execute the query from there itself

Jump to Post

All 3 Replies

Member Avatar

First check whether the view is really available in the database by execute the query from there itself

I already executed the view in MySQL browser and it's working properly but when I use it in PHP code still it doesn't exist.

i think your code is not correct. look at the code vividly. you only need to do is to search to google, there is a lot of sample their.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.