1

Hey guys, I'm trying to make a full-text search bar and already my script wont work... My php script is this...

<?php

MySQL_connect("hostname", "username", "password"); 
MySQL_select_db("our_db"); 
$query = " 
    SELECT * FROM articles 
    WHERE MATCH(title, body) AGAINST ('PHP') 
"; 
$sql = MySQL_query($query); 
/* output results */ 
?>

And when I try to preview it, it comes up with:

Fatal error: Call to undefined function MySQL_connect() Error in line 12 (line 12: MySQL_connect("hostname", "username", "password"); ) Server Error in '/' Application. -------------------------------------------------------------------------------- HTTP Error 500 - Internal Server Error.

... if any of you guys can work it out it would be much appreciated... Thanks

2
  • 'mysql_connect', not 'MySQL_connect', etc Commented Mar 6, 2011 at 1:52
  • yeah... i tried that it didn't work, thanks anyway. Commented Mar 6, 2011 at 1:54

1 Answer 1

2

Sounds like your PHP configuration is not setup for mySQL. Try using the phpinfo() function to see if it is.

Sign up to request clarification or add additional context in comments.

7 Comments

Just create a dummy script, with <?php phpinfo(); ?> and then navigate to that script. It will dump a lot, including what extensions are configured. Just look for a mysql entry, it should have version info if installed. Otherwise there will not be a mysql entry, or it will state that it is not configured.
@Sam: well, you could start by googling it.
Yh it came up with the php page, but what am i looking for? :L
They are all slightly different, but basicall, just do a search for mysql and you should get 1 or 2 boxes that list information like Client API version or mysql.default_host. If the boxes aren't there, or have values that suggesting it isn't configured, contact your host.
i did a search for mysql and the sections they were under were: Path, MySqlnd and _SERVER["path"]
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.