Jump to content

Recommended Posts

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";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790038
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790039
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790044
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790051
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/150386-sql-problems/page/2/#findComment-790052
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.