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);

Recommended Answers

All 3 Replies

Member Avatar for LastMitch

@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?

Member Avatar for LastMitch

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);
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.