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.

Member Avatar for rajarajan2017

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 meeting, networking, learning, and sharing knowledge.