Welcome! Log In Create A New Profile

Advanced

freewebhsoting/SQL not working

Posted by chers 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
freewebhsoting/SQL not working
October 21, 2013 11:54AM
is it just me or is the SQL links not working. I can see my databases but cannot access my tables.. am I doing something wrong??
Re: freewebhsoting/SQL not working
October 21, 2013 01:49PM
chers Wrote:
-------------------------------------------------------
> is it just me or is the SQL links not working. I
> can see my databases but cannot access my tables..
> am I doing something wrong??


Definatley ITS just you. You need make sure your query is running. You can verify that the query is running by adding an mysql error function to show you the same error you could get on the mysql command. So do like this just below your mysql query statement:


$query=mysql_query('select * from registration'winking smiley;//this example . you need put your query here

if (!$query) { // add this check to see if $query evaluated to true
die('Invalid query: ' . mysql_error()); //So now this code gives you an error from the mysql database
exit; //exit here to make sure you got the error straight into your eyes
}


Shout if this did not helped.
avatar Re: freewebhsoting/SQL not working
October 21, 2013 02:10PM
The php.ini display_errors is normally turned off in a public server, so no error messages will be shown.

It is a security issue.

The error messages are a gold mine for hackers.


Put this in your script to enable error reporting, if necessary. (Remove it when errors are fixed)

error_reporting(E_ALL);
Re: freewebhsoting/SQL not working
October 30, 2013 08:42PM
Please help me out, i am getting this error from the server,
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a2559824_0b'@'10.1.1.9' (using password: YES) in /home/a2559824/public_html/connect.php on line 3
MY password is not YES...my connection code is:
Language: PHP
<?php //Connecting to clubdata database $connection = mysql_connect("mysql1.000webhost.com","a2559824_0b","ob79061323") or die ("Couldn';t connect to the server");   $db = mysql_select_db("a2559824_club", $connection) or die ("Couldn';t select database"); ?>
avatar Re: freewebhsoting/SQL not working
October 30, 2013 09:54PM
The message is NOT that YES is your password, it is YES you are using a password.

You must connect to "localhost" (or "127.0.0.1" )

Language: PHP
$connection = mysql_connect("localhost","a2559824_0b","ob79061323")
Sorry, only registered users may post in this forum.

Click here to login