SkyRanger Posted April 9, 2007 Share Posted April 9, 2007 I have been fighting with this for about an hour, it is late, I can't see the problem. Somebody have a look at this and let me know that the heck I am doing wrong: if (empty($_SESSION['language']['lid'])) { $_SESSION['language']['lid'] = "1"; } // mysql include "inc/dbinfo.inc.php"; $connection=mysql_connect ("$dblocation", "$dbusername", "$dbpassword") or die ('I cannot connect to the database because: ' . mysql_error()); $result = mysql_query( "SELECT * FROM 'languages' WHERE lid = '" . $_SESSION['language'] ['lid'] . "'" ) or die(mysql_error()); Error I am getting is: 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 ''languages' WHERE lid = '1'' at line 1 Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted April 9, 2007 Author Share Posted April 9, 2007 Stupid me, found the problem, forgot to add the database Quote Link to comment Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 i always find the solutions just after i hit post button on this forum.. lol click solved Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted April 9, 2007 Share Posted April 9, 2007 ok, um in your error it says that the value of your session is '1', is that the value that yu want? Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted April 9, 2007 Share Posted April 9, 2007 lol, cool good luck Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted April 9, 2007 Author Share Posted April 9, 2007 That is the default until somebody chooses another language. But I found another problem, that is starting to tick me off: [b]Main PHP File[/b] include "./inc/get_language.php"; include "./lang" . $object->lpath . "main.lang.php"; include "install/header.inc"; echo NAME; include "install/footer.inc"; if (empty($_SESSION['language']['lid'])) { $_SESSION['language']['lid'] = '1'; } // mysql [b]get_language.php file[/b] include "inc/dbinfo.inc.php"; $connection=mysql_connect ("$dblocation", "$dbusername", "$dbpassword") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("$dbname"); $result = mysql_query( "SELECT * FROM languages WHERE lid = '" . $_SESSION['language']['lid'] . "'" ) or die(mysql_error()); And this is the error I am getting: Warning: include(./lang/main.lang.php) [function.include]: failed to open stream: No such file or directory Table data is: ____________________ | languages | |__________________| | lid | lpath | |__________________| | 1 | /english/ | | 2 | /french/ | |__________________| Can anybody see the problem? Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted April 9, 2007 Author Share Posted April 9, 2007 Has anybody got any ideas, not sure if I am missing a piece of code in the main.php file or what. The error I get is: Warning: include(./langmain.lang.php) [function.include]: failed to open stream: No such file or directory in /home/mysite/public_html/main.php on line 6 Warning: include() [function.include]: Failed opening './langmain.lang.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mysite/public_html/main.php on line 6 This is how I need it to include: include './lang/english/main.lang.php'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.