Sobbs Posted March 21, 2009 Author Share Posted March 21, 2009 Ive done that, however, im still seing no error messages. <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); $con = mysql_connect("sql312.byethost33.com","b33_3176976","n00b1234"); if (!$con) { die('Could not connect: ' . mysql_error()); }else{ echo "Connected to DB"; } $db = mysql_select_db("b33_3176976_lunadb", $con); if (!$db) { die('Could not connect: ' . mysql_error()); }else{ echo "DB selected"; } if (!mysql_query("INSERT INTO `DB_Guide` (`gid`, `uname`, `gname`, `icon`, `dsc`, `cat`, `body`, `score`) VALUES (NULL, 'test', 'test', 'test', 'test', '1', 'test', '0')")) { echo mysql_error(); } else { echo "success"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790038 Share on other sites More sharing options...
Ninjakreborn Posted March 21, 2009 Share Posted March 21, 2009 Ok do this. Clear out all your code (back it up first and try this. echo 'hello'; Tell us if it outputs hello. If not try phpinfo(); and tell us if that outputs. If none of that works then there is something wrong with your server configuration, ini file, or something that is preventing PHP pages from running. Quote Link to comment https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790039 Share on other sites More sharing options...
Sobbs Posted March 21, 2009 Author Share Posted March 21, 2009 Those do work. I tried running my code on another server and I had the same results. No errors, and nothing added. Quote Link to comment https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790040 Share on other sites More sharing options...
redarrow Posted March 21, 2009 Share Posted March 21, 2009 echo the insert statement out then. Quote Link to comment https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790041 Share on other sites More sharing options...
Sobbs Posted March 21, 2009 Author Share Posted March 21, 2009 echo the insert statement out then. What do you mean by that? Quote Link to comment https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790042 Share on other sites More sharing options...
Ninjakreborn Posted March 21, 2009 Share Posted March 21, 2009 There are no syntax errors. I just ran your code. Most likely your INI file or server are setup to not show error messages so when you start it up it runs a problem at the very start. I am almost sure it's you database connection information. Have you verified your username, password, and host information are all accurate based off of your webhost. Have you also verified the DB name as well. Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'sql312.byethost33.com' (10060) in C:\xampp\htdocs\test.php on line 5 Could not connect: Can't connect to MySQL server on 'sql312.byethost33.com' (10060) That is my response when I run the code so there are no abnormal syntax errors or strange output errors. It's simply a connection error. If your connection information is wrong then that could be causing the blank page. Quote Link to comment https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790044 Share on other sites More sharing options...
redarrow Posted March 21, 2009 Share Posted March 21, 2009 businessman has asked you, can you echo the hello you said yes. That means that you php server is working because the page is phasing throw php. now business man cheeked your code and it working his end. He gone over your code with a tooth brush and come to the conclusion, it a database connectivity problam. The reason for no errors can be a setting in the php.ini or the database schema. Is there a virus on the machine? just asking. Quote Link to comment https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790051 Share on other sites More sharing options...
Ninjakreborn Posted March 21, 2009 Share Posted March 21, 2009 I am signing off for the time being. If you are unable to figure this out then PM me the login information to the site..the name of the page and a link. When that happens I will go ahead and try to work you through it manually if you are still having problems. Only PM me if you have tried everything else and no-one is able to help you work through it yourself. Quote Link to comment https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790052 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.