It is currently Thu Mar 28, 2024 8:51 am


All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: php and mysql interoperability
PostPosted: Thu Feb 10, 2005 7:14 pm 
Noobie
Noobie

Joined: Thu Feb 10, 2005 7:05 pm
Posts: 6
hi, i'm trying to put some php script working with the mysql database but i'm having trouble establishing the connection. i might be a little confused by the setup they've got.

i created a database called ctaclas_tagboard, it looks like the username and database name are the same by default, but i'm not sure. i gave it a password and created a table called posts with a couple of fields and filled in a couple of rows.

i next created a php script to try to connect to the database. it appears that it's not connecting successfully. heres my code that i tried:

$conn = mysql_connect('ctaclas.freelinuxhost.com', 'ctaclas_tagboard', 'password');
echo $conn;

and this is the error code i get:

Warning: mysql_connect(): Host '67.19.214.227' is not allowed to connect to this MySQL server in /home/www/ctaclas.freelinuxhost.com/tagboard.php on line 10

anybody know what i'm doing wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 10, 2005 7:15 pm 
Noobie
Noobie

Joined: Thu Feb 10, 2005 4:17 pm
Posts: 5
You have to use "freelinuxhost.com" as hostname.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 10, 2005 8:14 pm 
Noobie
Noobie

Joined: Thu Feb 10, 2005 7:05 pm
Posts: 6
sweet thanks, got it working :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 10, 2005 8:20 pm 
Noobie
Noobie

Joined: Thu Feb 10, 2005 7:05 pm
Posts: 6
btw, do you know if it supports the mysqli interface?
i use php5 on my apache server and i use the mysqli interface, but i'm not sure which version it's been introduced. i tried connecting and it seems like its not working


Top
 Profile  
 
 Post subject: php version on server
PostPosted: Fri Feb 11, 2005 8:05 am 
Site Admin
Site Admin

Joined: Fri Feb 11, 2005 7:43 am
Posts: 1818
Location: 100WebSpace's Headquarters
The PHP version on the server is 4.3.4 and the MySQL version is 4.0.23_Debian-1. You should be able to check for yourself whether these versions support mysqli interface or not.

_________________
Read the F.A.Q. before asking a question!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 12, 2005 6:59 am 
Noobie
Noobie

Joined: Thu Feb 10, 2005 7:05 pm
Posts: 6
is it just my page thats messed up or is it server wide?
my page has two php scripts that worked fine last night but now they don't work today. if you're interested they're http://ctaclas.freelinuxhost.com/calculator.php and http://ctaclas.freelinuxhost.com/tagboard.php
i get this message:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, support@100webspace.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



--------------------------------------------------------------------------------

Apache/1.3.33 Server at ctaclas.freelinuxhost.com Port 80


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 12, 2005 7:12 am 
Noobie
Noobie

Joined: Sat Feb 12, 2005 6:55 am
Posts: 14
It must be server wide I'm getting the same error and have been for almost 5 hours now.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, support@100webspace.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/1.3.33 Server at magickalforest.com Port 80

the site is running on freelinuxhost.com


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 12, 2005 8:03 am 
Noobie
Noobie

Joined: Thu Feb 10, 2005 7:05 pm
Posts: 6
cool i was kind of getting paranoid that maybe i wasn't parsing user input good enough and someone got clever and used some sort of sql insertion trick to mess up my site :)
i'm gonna add some input parsing though to make sure that can't happen though


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 12, 2005 8:54 am 
Noobie
Noobie

Joined: Thu Feb 10, 2005 7:05 pm
Posts: 6
it looks like it works :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ]  Moderators: fhmagic, KJ, Moderators, Support Team

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
100WebSpace © 2011