mysql file name query problem

 
0
 

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

Featured Replies in this Discussion

  • by
    LastMitch
    @CreatorZeus ... This function doesn't work: ... You need to try mysqli_query() function In the future used mysqli functions. To solve your issue just add this ...
    Post Contains: Links Quotes Code
LastMitch
Deleted Member
 
1
 

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

where do i add it?

LastMitch
Deleted Member
 
0
 

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);
Question Answered as of 2 Years Ago by LastMitch
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: