Lol, you're all looking at the query, did no one notice his incorrect syntax for include?
Btw, you shouldn't use include, use Require instead.
Some ideas to help you fix this:
- Make sure that #__content is the correct table name.
- Remove the semi-colon after the '3' in the query (id='3';)
- You cannot just echo $sql_result , i added a line of code to it first.
CODE
<?php
require('dbinfo.php');
//connect to db
$connection = mysql_connect("$DBHOST","$DBUSER","$DBPASS");
mysql_select_db("$DBNAME");
//get data
$sql = "SELECT title FROM #__content WHERE id='3'";
$sql_result = mysql_query($sql,$connection) or die(mysql_error());
$sqlvars = mysql_fetch_array($sql_result);
echo $sqlvars['title'];
?>
but, when I run it, i get this very helpful error message
CODE
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
That error is definitely pointing at that semi-colon at (id='3';)
Hope my ideas help. (and yea i know some people mentioned some of them earlier already, i hope i made them clearer.)
~Darklighter