herghost Posted August 19, 2007 Share Posted August 19, 2007 Hi All, I have recently installed the softbiz jobs and recruitment script, and have a page full of errors as shown : www.findjobswith.us I have contacted softbiz but there support is non existent! I have tried re-installing but was left with the same errors. I was wondering if anyone knows a fix to this and as this is my 1st dive into php could also explain whats happening. Many thanks Dave Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/ Share on other sites More sharing options...
sasa Posted August 19, 2007 Share Posted August 19, 2007 all your error is mean that scrip can not connect to database or database don't setup right Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328064 Share on other sites More sharing options...
Hybride Posted August 19, 2007 Share Posted August 19, 2007 Your header problem, at the beginning of all your scripts, start it off with ob_start(); That starts the buffer that you can place your headers anywhere on the script. You're actually going to have to log off/on the page to see the changes (at least, that's what I always have to do.) If that doesn't work, after you added the buffer, c&p the script again. And in every page you see this error: Warning: mysql_fetch_array(): OR mysql_num_rows(): go to your $query (could be named that or mysql_query or something of that nature), and at the end of the piece, add "OR die(mysql_error());". So the long hand version is this: $query = "SELECT * FROM table WHERE something = '$something'"; $result = mysql_query($query) OR die(mysql_error()); Or the short-hand: mysql_query("SELECT * FROM table") OR die(mysql_error()); That should do the trick. Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328071 Share on other sites More sharing options...
herghost Posted August 19, 2007 Author Share Posted August 19, 2007 Thank you very much for your help so far, I think i get what you are saying, as I said I am very new to all this. I have now changed the line to: $online=mysql_fetch_array(mysql_query("select * from sbjbs_online where sb_ip='$ip'")OR die(mysql_error()); An I am getting this error: Parse error: syntax error, unexpected ';' in /home/findjobs/public_html/myconnect.php on line 31 Is this a very simple mistake on my part? Thanks Dave Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328123 Share on other sites More sharing options...
MadTechie Posted August 19, 2007 Share Posted August 19, 2007 can you post the file /home/findjobs/public_html/myconnect.php or lines 28 to 33 please use code # tags Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328148 Share on other sites More sharing options...
herghost Posted August 19, 2007 Author Share Posted August 19, 2007 Thank you again for your reply, this is line 29 to 43 //==========================online visitors mysql_query( "DELETE FROM sbjbs_online WHERE UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(sb_ontime) >$to_secs") ; $online=mysql_fetch_array(mysql_query("select * from sbjbs_online where sb_ip='$ip'")OR die(mysql_error()); if($online) { mysql_query("update sbjbs_online set sb_ontime=$t_stamp,sb_uid=$uid where sb_ip='$ip'"); } else { mysql_query("insert into sbjbs_online (sb_ontime,sb_ip,sb_uid) values($t_stamp,'$ip',$uid)"); } /* $num=mysql_num_rows(mysql_query("select * from sbjbs_online")); echo $num;*/ ?> Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328154 Share on other sites More sharing options...
MadTechie Posted August 19, 2007 Share Posted August 19, 2007 Missing ) change $online=mysql_fetch_array(mysql_query("select * from sbjbs_online where sb_ip='$ip'")OR die(mysql_error()); to $online=mysql_fetch_array(mysql_query("select * from sbjbs_online where sb_ip='$ip'")OR die(mysql_error())); or more readable $SQL = "select * from sbjbs_online where sb_ip='$ip'"; $result = mysql_query($SQL)or die(mysql_error()); $online=mysql_fetch_array($result); Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328160 Share on other sites More sharing options...
herghost Posted August 19, 2007 Author Share Posted August 19, 2007 Thankyou very much, however now I am getting a 'no database selected' message when I know the details are entered correctly. Many thanks for your patience, I hope I am learning something here! Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328192 Share on other sites More sharing options...
MadTechie Posted August 19, 2007 Share Posted August 19, 2007 try this updated $link = mysql_connect('localhost', 'USERNAME', 'PASSWORD'); if (!$link) { die('Not connected : ' . mysql_error()); } $db_selected = mysql_select_db('YOUR_DATABASE_NAME', $link); $SQL = "select * from sbjbs_online where sb_ip='$ip'"; $result = mysql_query($SQL)or die(mysql_error()); $online=mysql_fetch_array($result); please note the 'USERNAME', 'PASSWORD' & 'YOUR_DATABASE_NAME' these need to be your settings Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328196 Share on other sites More sharing options...
herghost Posted August 19, 2007 Author Share Posted August 19, 2007 Thankyou, it was an error on my part, I had the not added the user to the database. However I still have the original error displaying, but all the others have dissappeard I think. Well for the index page anyway. UPDATE - Not to worry, I added a @ at the start of the line and that seems to work. Many thanks to all that helped Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328200 Share on other sites More sharing options...
MadTechie Posted August 19, 2007 Share Posted August 19, 2007 can you post myconnect.php remove the user/pass for the post or post lines 28 to 35 should do it i assume its updated Quote Link to comment https://forums.phpfreaks.com/topic/65686-solved-help-with-script-please/#findComment-328202 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.