A
Anonymous
Guest
Code:
<?php
function le_mysql_connect()
{
global $host,$database,$dbuser,$dbpassword;
$connection = mysql_connect($host,$dbuser,$dbpassword);
$db = mysql_select_db($database);
return $db;
}
function le_visitor_info()
{
global $_COOKIE['le_username'];
$query_visitor = "SELECT * FROM members WHERE username='".$_COOKIE['le_username']."'";
$result_visitor = mysql_query($query_visitor);
$row_visitor = mysql_fetch_array($result_visitor);
return $row_visitor;
}
function smilies()
{
$query_smilies = "SELECT * FROM smilies";
$result_smilies = mysql_query($query_smilies);
$smilies_search = array();
$smilies_replace = array();
while ($row_replace = mysql_fetch_array($result_smilies))
{
$smilies_search[] = $row_replace['code'];
$smilies_replace[] = '<img src="'.$row_replace['image_location'].'">';
}
return $smilies_search[];
return $smilies_replace[];
}
?>
I get this error:
Code:
Parse error: parse error, expecting `','' or `';'' in /home/virtuoso/public_html/post/functions.php on line 11
If I remove
Code:
global $_COOKIE['le_username'];
Code:
Fatal error: Cannot use [] for reading in /home/virtuoso/public_html/post/functions.php on line 27
I don't even know if I get the functions correct.
should I just write out the entire code instead of using functions. This is the first time I created my own function.