| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Closed Join Date: Apr 2007
Posts: 52
![]() | got a question : php + mysql = love the title is just to make u read this topic ![]() What is the best Free news script which is available online ? i am planning to run a news site and am not sure what script to choose anyways i want to know how can i take data from a mysql database which is not on my server like i got a database on an other server i want to take data from it from my first server how is the code in php for that written thx
Last edited by counter; 11-11-2007 at 01:51 AM.
Reason: s
|
| |
| | #2 (permalink) |
| Danltn.com Join Date: May 2007 Location: Danltn.com / Nottingham, UK
Posts: 1,201
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Code: mysql_connect('server', 'mysql_user', 'mysql_password');
Can be expanded to...
$link = mysql_connect('example.com:3307', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
__________________
Last edited by Danltn; 11-10-2007 at 12:07 PM.
|
| |
| | #3 (permalink) |
| Senior Member Join Date: Aug 2005 Location: East Yorkshire, England
Posts: 2,689
![]() ![]() ![]() ![]() ![]() ![]() ![]() | No need for a $link variable, unless you plan to have multiple connections open at once. PHP Code: |
| |
| | #4 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | What danltn has provided is 100% correct but bear in mind that the database server must be set up to allow connections from external sources (most people set up their servers to only allow connections from trusted people. Also if the mySQl server is on a different network then you will encounter lag time. If you are using it to output data to a user then the load time of the page will be affected adversely.
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft |
| |
| | #5 (permalink) |
| DNOA Member Join Date: May 2004
Posts: 5,040
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Don't get intimidated by all the configuration. it's not too difficult. In CPanel, set an access host on the database server to be the IP address of the client system that is accessing it. Then, if it still doesn't work, contact your database server's host to disable any firewalls for that domain on port 3307. Even if you didn't order firewall services, their networking team may have instilled a block on it. I had to do this to get my C# application on my PC to access a database on my server in Canada. The support team figured out what was causing the block and fixed it. It's really simple, really then: 1. Set access host to allow the IP of the accessor. ????: NamePros.com http://www.namepros.com/showthread.php?t=394376 2. Contact host of db server if there are still problems. |
| |
| | THREAD STARTER #6 (permalink) |
| Account Closed Join Date: Apr 2007
Posts: 52
![]() | ok guys that was helpful ( i just wanted to know the way to write it) ill try it and let u know the result anyways i got more important question i am working on a news script that is about to collaps as its going to take me sometime to make a proper one when i can find loads of good scripts online What is the best Free news script which is available online ? i am planning to run a news site and am not sure what script to choose |
| |
| | #7 (permalink) |
| Senior Member Join Date: Oct 2005 Location: Kent ~ U.K.
Posts: 3,209
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | An alternative to reading it from MySql is CuteNEWS. It is a fantastic news system, that uses flat files (information stored in files): http://cutephp.com/cutenews/ It is very easy to use! They do, however, have a copyright that is placed at the bottom of your page. Joe
__________________ Myself and "JackHeskett" are no longer associated with FusedHosting.net. Please pipe all PMs to admin [at] fusedhosting.net. |
| |
| | #11 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | wordpress is a blogging software http://wordpress.org/
__________________ Manage your portfolio using my new Domain Portfolio Management script. Securing Your Domain Name From Theft |
| |
| | #12 (permalink) | ||||
| Danltn.com Join Date: May 2007 Location: Danltn.com / Nottingham, UK
Posts: 1,201
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
http://www.google.co.uk/search?q=WordPress http://search.yahoo.com/search?p=WordPress http://www.ask.com/web?q=WordPress http://search.live.com/results.aspx?q=WordPress All of which it ranks #1 for... Along with http://wordpress.org (and other exts.) Did you even try searching for it? Here's the link: http://wordpress.org
__________________ | ||||
| |
| | THREAD STARTER #13 (permalink) |
| Account Closed Join Date: Apr 2007
Posts: 52
![]() | actualy i searched for Words Press check what i got http://www.google.co.uk/search?hl=en...G=Search&meta= |
| |