Start New Discussion within our Web Development Community

trying to search by the file name
keep getting a "expects parameter 1 to be resource, boolean" error
what am i missing?

$pagename = basename($_SERVER['PHP_SELF'], ".php");
mysql_select_db("tagpoint", $con);
$sql="SELECT * FROM tagpoint WHERE title = '".$pagename."'";
$result=@mysql_query($sql);
$row = mysql_fetch_array($result);

@CreatorZeus

keep getting a "expects parameter 1 to be resource, boolean" error

This function doesn't work:

http://php.net/manual/en/function.mysql-query.php

You need to try mysqli_query() function

In the future used mysqli functions.

To solve your issue just add this

$result= mysql_query($sql,$con);

where do i add it?

I just gave you the code:

$result= mysql_query($sql,$con);

Just add

$con 

to this:

$result= mysql_query($sql);

and you will get this:

$result= mysql_query($sql,$con);
This question has already been answered. Start a new discussion instead.