NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page got a question : php + mysql = love

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 11-10-2007, 12:03 PM THREAD STARTER               #1 (permalink)
Account Closed
Join Date: Apr 2007
Posts: 52
counter is an unknown quantity at this point
 



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
counter is offline  
Old 11-10-2007, 12:04 PM   #2 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 


Ethan Allen Fund Ethan Allen Fund
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);
You'll need the settings that govern external DB connections to be set up correctly.
Last edited by Danltn; 11-10-2007 at 12:07 PM.
Daniel is offline  
Old 11-10-2007, 12:23 PM   #3 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to behold
 




No need for a $link variable, unless you plan to have multiple connections open at once.

PHP Code:
mysql_connect('example.com:3307''mysql_user''mysql_password')or die(mysql_error());
????: NamePros.com http://www.namepros.com/programming/394376-got-a-question-php-mysql-love.html

/* Stuff Here */

mysql_close(); 
Barrucadu is offline  
Old 11-10-2007, 12:32 PM   #4 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
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
Peter is offline  
Old 11-10-2007, 09:29 PM   #5 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
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.
mholt is offline  
Old 11-11-2007, 01:33 AM THREAD STARTER               #6 (permalink)
Account Closed
Join Date: Apr 2007
Posts: 52
counter is an unknown quantity at this point
 



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
counter is offline  
Old 11-11-2007, 06:37 AM   #7 (permalink)
Joe
Senior Member
Join Date: Oct 2005
Location: Kent ~ U.K.
Posts: 3,209
Joe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud ofJoe has much to be proud of
 


Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
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.
Joe is offline  
Old 11-11-2007, 12:34 PM THREAD STARTER               #8 (permalink)
Account Closed
Join Date: Apr 2007
Posts: 52
counter is an unknown quantity at this point
 



hmm
saw this please do u know other (better or without credit)

BTW please guys i want it very very search engines friendly
counter is offline  
Old 11-13-2007, 07:56 PM   #9 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Well, WordPress could be modded up a bit...
mholt is offline  
Old 11-25-2007, 12:37 PM THREAD STARTER               #10 (permalink)
Account Closed
Join Date: Apr 2007
Posts: 52
counter is an unknown quantity at this point
 



oh where can i get WordPress
i googled it i couldnt find what am searching for what is that
counter is offline  
Old 11-25-2007, 12:49 PM   #11 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
wordpress is a blogging software http://wordpress.org/
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 11-25-2007, 01:24 PM   #12 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 


Ethan Allen Fund Ethan Allen Fund
Originally Posted by counter
oh where can i get WordPress
i googled it i couldnt find what am searching for what is that
Wow, no offence but that is the dumbest thing I've ever heard.

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
Daniel is offline  
Old 11-27-2007, 12:51 AM THREAD STARTER               #13 (permalink)
Account Closed
Join Date: Apr 2007
Posts: 52
counter is an unknown quantity at this point
 



actualy i searched for Words Press check what i got http://www.google.co.uk/search?hl=en...G=Search&meta=
counter is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:12 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger