Content Top
DAL Computer Help » Web Design, Development & Marketing » Web Development Help » PHP Help » php parse error

php parse error


HEY! You're not logged in which is fine if you simply want to browse for answers, however if you want to post your own Questions and hangout here you need to Register! ...Registration takes 2 minutes and is completely free. If you have already registered simply log in using the form to the right.

Reply
Thread Tools
PHP Help
Old 18-07-2005, 01:28 AM   #1 (permalink)
D-A-L Newbie
 
Status: Newbie
Join Date: Jul 2005
Posts: 1
 in8inteligence Is a beginner here at D-A-L



in8inteligence is offline  
php parse error

I am getting a parse error on line 1 unexpected $ and Have looked and looked and my blinders are up. Any suggestions

<?php
include_once('config.php');
global $db_list;
$db_list['db_name']=$weightlo['SQL_DB'];
$db_list['article']="asb_articles";
$db_list['tags']="asb_sourcetags";
$db_list['search']="asb_search";
$db_list['cat_articlecity']="asb_cat_articlecity";
$db_list['cat_ezinearticles']="asb_cat_ezinearticles";
$db_list['cat_goarticles']="asb_cat_goarticles";
function aconnect(){
global $db_list;
global $USER_VAR;
//$password="test123";
// Connect with the mySQL database
if (!$link = mysql_connect($USER_VAR['SQL_HOST'], $USER_VAR['SQL_USER'], $USER_VAR['SQL_PASS']))
{ echo mysql_error()."<br>";
die ("Could not connect");
return 0;
}
////print ("Connected successfully");
if (!mysql_select_db ($USER_VAR['SQL_DB']))
{echo mysql_error()."<br>";
die ("Could not select database");
return 0;
}
//echo "Connected!<br>";
return 1;
}
// Put search info into DB
function put_search_info($info)
{global $db_list;
//print_r($info);
$query = "INSERT INTO `".$db_list['search']."` (`total`, `output_dir`, `cat_ac`, `cat_ga`, `article_temp`, `index_temp`, `index_size`, `link_size`, `filter`) VALUES ('".$info['total']."', '".$info['output_dir']."', '".$info['cat_ac']."', '".$info['cat_ga']."', '".$info['article_temp']."', '".$info['index_temp']."', '".$info['index_size']."', '".$info['link_size']."', '".$info['filter']."')";
if (!doQuery($query))
{echo "Data not inserted into ".$db_list['search'].".<br>";//".$query."<br>";
return 0;
}
else return 1;
}//END put search info

function get_templates()
{aconnect();
global $db_list;
$query = "SELECT `article_temp`,`index_temp` FROM `".$db_list['search']."` LIMIT 0,100000";
doQuery($query);
global $result;
if (mysql_num_rows ($result)=="0"){return FALSE;}
while($res=mysql_fetch_array($result))
{//print_r($res);
//echo $res[0]."<br>";
$art[].=$res[0];
//echo $res[1]."<br>";
$ind[].=$res[1];
}
$full=array($art,$ind);
return $full;
}

// Write article info to the 'article' DB.
function put_article ($article_info)
{
// An array of the DB names
global $db_list;
//FIRST LOOK FOR URL in DB:
$query="SELECT `url` FROM `".$db_list['article']."` WHERE `url` = '".addslashes($article_info['url'])."'";
doQuery($query);
global $result;
$res=mysql_fetch_array($result);
if ($res[0]==addslashes($article_info['url'])){return;}
else {
$query = "INSERT INTO `".$db_list['article']."` (`url` , `title` , `author` , `article` , `resource_box`)
VALUES (
'".addslashes($article_info['url'])."', '".addslashes($article_info['title'])."', '".addslashes($article_info['author'])."', '".addslashes($article_info['text'])."', '".addslashes($article_info['resource_box'])."'
);";
if (!doQuery($query))
{echo "Data not inserted into ".$db_list['article'].".<br>";//".$query."<br>";
return 0;
}
else return 1;
}
}// END put_article
function get_sql ($query)
{//echo $query;
if (!$sql_res = mysql_query($query))
{echo "There was an error: <br>".mysql_error()."<br>";
return false;}
else return $sql_res;
}
function doQuery($query)
{
global $result;
////print"<br>++++++<br>".$query."<br>++++++<br>";
if (!$result = mysql_query($query))
{//echo ("doquery");
echo mysql_error().'<br><b>'.$query.'</b>';
return 0;
}

return 1;
}
function getRow($id)
{
aconnect();
$query=" SELECT *
FROM aa
WHERE id='$id'";
//echo $query;
if (!$result = mysql_query($query))
{
echo mysql_error().'<br>';
return 0;
}
return mysql_fetch_assoc($result);
}
?>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Advertisement - Register to remove Ads its free!

Old 11-08-2005, 11:12 PM   #2 (permalink)
Tech Rank 1/5
 
Status: Junior Member
Join Date: Jul 2005
Posts: 32
 Sprocket Is a beginner here at D-A-L



Sprocket is offline  
Re: php parse error

try just using this near the top,
instead of,
include_once('config.php');
try,
require "config.php";


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ewido Problem (RESOLVED) SoItGoes Spyware, Adware, Viruses and HijackThis Logs 16 10-05-2006 04:02 PM
Online Crash sharonuktang Windows XP Help 2 05-04-2006 10:24 PM
Internet Explorer errors and then auto closes thekid00001 General Internet Issues and Questions 5 06-07-2005 04:29 AM
another about:blank victim weird_abby Spyware, Adware, Viruses and HijackThis Logs 26 06-11-2004 11:00 PM
Search Extender, shopping wizard, home search assistant pencapchew Spyware, Adware, Viruses and HijackThis Logs 12 23-08-2004 09:26 PM


All times are GMT +1. The time now is 05:58 AM.

Bottom Corner