connect to mysql
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
Home
Download Test
Test Your Download Speed
Test Download AND Upload
Upload Test
Test Your Upload Speed
Test Upload AND Download
Community Forum
Community Forum Home
» Log-In
» Register
Internal Search
Google Powered Search
Computer & Net Guides
ISP Discussion
Forum Sitemap
Member List
Forum Stats
Forum Help and Info
Calendar & Birthdays
Database Stats
Host Stats
Member Stats
Share Score
Misc Tools
Conversion Calc.
Speed Chart
Conversion Table
Create a Test
Share Score
Automatic Test
Forum Archive
RSS and Blog Feeds
Score Database
trace/ping/whois/DNS
Wallpapers
Tweak Guide
!! Forum Search !!
!! Google Search !!
TMN Detailed Sitemap
News
News Home
Join
Theme
See Theme List
America the Beautiful
Blacken
Dark Blood Red
Blue
Blue Black Box
Blue Gray
Brown
Christmas
Dark Blue
ekaf
GL Series (default)
Gray Shades
Original Feel
Green
Greenhouse
Greenhouse Gray
Halloween Theme
Orange
Purple Darkness
Red/pink
Red 'n Black
TurkeyDay!
» Neuron (Default)
Neuron Black
Rise (New!)
Click to read why...
News
: testmy.net 2010 is coming very soon... stay tuned for the next generation of testmy.net!
November 21, 2009, 06:48:22 PM
testmy.net Broadband
|
Main Forum
|
HELP!
| Topic:
connect to mysql
Recommended Tests
TIP:
Test how fast your system is really running
Free Performance Scan
TIP:
Test how many system errors your PC has
Free PC Error Scan
Note: The links above are sponsored links
0 Members and 1 Guest are viewing this topic.
« previous
next »
Topic Tools
Search this topic
Pages
1
Author
Topic: connect to mysql (Read 1688 times)
cbtshare
Jr. Member
Offline
Posts: 21
connect to mysql
«
on:
December 04, 2008, 04:52:26 PM »
Hey sup,
I have installed apache 2.2 on windows and mysql as well.I created a database and also a function , but I cant seem to connect to the database via the browser.(I installed php on apache as well)this is what I have and the error i'm getting.
<code>
<?php
// Connect to the database
$dbhost = 'localhost';
$dbusername = 'root';
$dbpasswd = '***';
$database_name = 'simple';
$connection = mysql_connect("$dbhost","$dbusername","$dbpasswd")
or die ('Couldn\'t connect to server.');
$db = mysql_select_db("$database_name", $connection)
or die('Couldn\'t select database.');
// Generate SQL code to store data on database.
$insert_sql = 'INSERT INTO simple_table (text) VALUES (\'test text, 1,2,3\')';
// Execute SQL code.
mysql_query( $insert_sql )
or die ( 'It Didn\’t Work: ' . mysql_error() );
// Tell User we are done.
echo 'Code Inserted';
?>
</code>
ERROR:
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test_insert_sql.php on line 7
line 7 is... $connection = mysql_connect("$dbhost","$dbusername","$dbpasswd")
the password and username is right I also use mysl-front and it connects fine with it.
Help please..
Logged
mudmanc4
Ɠξξ₭ òƒ Ɠξξ₭z
Global Moderator
TMN Seasoned Veteran
Online
Gender:
Posts: 6531
Re: connect to mysql
«
Reply #1 on:
December 04, 2008, 07:38:12 PM »
That error looks like a new install without mysql support, you probably forgot to copy the mysql.dll to your php directory. No ?
Logged
Don't do what others say - listen to them, but do what you feel good doing. ~ Warren Buffet
cbtshare
Jr. Member
Offline
Posts: 21
Re: connect to mysql
«
Reply #2 on:
December 04, 2008, 08:11:04 PM »
wow never read that anywhere, where would I find the mysql.dll to copy(guessin in the mysql folder)..will try and get back to you.
Thanks
Logged
cbtshare
Jr. Member
Offline
Posts: 21
Re: connect to mysql
«
Reply #3 on:
December 04, 2008, 08:25:34 PM »
still didnt work,
I keep getting error @ mysql_connect("server", "root", "paws") or die(mysql_error());
Logged
Swimmer
Vice Admin
TMN Seasoned Veteran
Offline
Gender:
Posts: 6410
Re: connect to mysql
«
Reply #4 on:
December 04, 2008, 09:13:01 PM »
can you run this for us:
Code:
<?php
phpinfo
();
?>
Logged
cbtshare
Jr. Member
Offline
Posts: 21
Re: connect to mysql
«
Reply #5 on:
December 04, 2008, 09:28:44 PM »
here ya go
http://ontariowiz.com/test.php
Logged
Swimmer
Vice Admin
TMN Seasoned Veteran
Offline
Gender:
Posts: 6410
Re: connect to mysql
«
Reply #6 on:
December 04, 2008, 09:44:00 PM »
good.. you got php installed correctly.. php5 doesnt not include mysql support..
Quote
Unfortunately PHP5 removed built-in support for MySQL. To get it to work, the easiest way is to copy the mysql library file by hand. Open the folder you unzipped your PHP to. Copy the libmysql.dll file (should be located like C:\php\libmysql.dll ) into your Window's System folder (usually C:\Windows\System32\ although might be C:\WinNT\System\ or something).
Then open up your php.ini in a text editor and search for ;extension=php_mysql.dll and remove the ; infont of that line.
Restart Apache and see if you get any errors. If it complains about "php_mysql.dll" either your extension directory isn't correct or windows can't find libmysql.dll
That should fix the issue. System32 is the best bet.. as it is already in the Windows PATH variable.
Logged
cbtshare
Jr. Member
Offline
Posts: 21
Re: connect to mysql
«
Reply #7 on:
December 04, 2008, 10:05:08 PM »
thak you very very much IT guru swimmer!! it worked.
**little note**
when installing php you have to copy the php.ini file into windows system32 as well, but dont edit that one.Edit the one in your php folder...(Just incase anyone else has this issue.)
Thanks ALOT Everyone
Logged
Swimmer
Vice Admin
TMN Seasoned Veteran
Offline
Gender:
Posts: 6410
Re: connect to mysql
«
Reply #8 on:
December 04, 2008, 10:06:49 PM »
Not a problem.. glad it worked! I normally dont use Windows for website stuff.. So I learned something also.
Logged
Pages
1
testmy.net Broadband
|
Main Forum
|
HELP!
| Topic:
connect to mysql
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Main Forum
-----------------------------
=> General Discussion
=> New Members
=> PC Security
===> Antivirus & Firewalls
===> Spyware & Malware
===> Viruses & Scams
===> Security Threats
=> Show off your scores!
=> Make it Faster...
=> HELP!
===> HELP! With Other Stuff
===> HELP! With Tests
===> HELP! With Forum
===> Programming and Website Help
=====> HTML
=====> PHP
=====> PERL
=====> Server Help
===> Networking and Hardware
===> Overclocking
===> Linux Help
=> News
===> testmy.net News and Updates
===> Off Topic Headline News
=> Online Gaming Discussion
===> Requests
===> America's Army
===> Battlefield
===> Call Of Duty 4
===> Counter-Strike 1.6
===> Counter-Strike : Source
===> Day of Defeat : Source
===> Diablo
===> F.E.A.R
===> Ghost Recon
===> Halo 2
===> Lineage 2
===> Quake
===> Rainbow Six 3
===> World of Warcraft
===> Tribes 2
===> Unreal Tournament
=> Graphics, Sigs and Pictures
===> Test Board
=> Guides
=> Got any ideas to make testmy.net better?
=> Off Topic Discussion
===> Politics & More
-----------------------------
Provider Discussion and Reviews
-----------------------------
=> Add a Provider
=> All Dial-up
=> North American Providers (Including Canada)
===> Canadian Providers
=====> teksavvy.com Canada
=====> xplornet.com Canada
=====> Persona Internet
=====> Rogers Communications
=====> Shaw Communications
=====> Sympatico (Bell Canada)
===> Adelphia Communications
===> ALLTEL Communications
===> AOL
===> AT&T
=====> SBC Global
=====> BellSouth
===> Cable One
===> Cavalier Telephone cavtel.net
===> cebridge.net
===> CenturyTel
===> Charter Communications
===> Clearwire
===> Comcast Cable Communications
===> Country Cablevision
===> Covad communications
===> Cox Communications
===> DMAX Puerto Rico
===> EarthLink
===> EMBARQ
===> Frontier Online
===> HughesNet (DIRECWAY)
=====> DW4000 Information
=====> DW6000 Information
=====> DW7000 Information
===> Insight Broadband
===> Magtel Wireless
===> Mediacom Communications
===> Midcontinent Communications
===> mycingular.net
===> Namesco/NDO (ndo.com)
===> onelinkpr.net Puerto Rico
===> Optimum Online
===> Qwest Communications
===> RCN
===> RoadRunner (Time Warner Cable)
===> seidata.com
===> sigecom.net
===> SkyWay USA
===> Speakeasy
===> Sprint Nextel Corporation
===> Starband
===> Suddenlink
===> SureWest Communications
=====> SureWest Communications FIOS
===> SusCom - Susquehanna Communications
===> TDS - Telephone and Data Systems, Inc
===> Transedge.com
===> Verizon Online
===> Verizon Online FIOS
===> Wave Broadband
===> Wide Open West
===> Wildblue Communications, Inc
=> World Providers (Non-North American)
===> African Providers
===> Asian and Middle Eastern Providers
=====> Asian Providers
=====> Centennial
=====> Digitel
=====> PLDT myDSL
=====> Sify Broadband
=====> Streamyx
=====> Smart Bro (Wi-fi)
===> Australian Providers
=====> Digiplus
=====> Optusnet
=====> Telstra Bigpond
===> UK and European Providers
=====> Bredbandsbolaget
=======> Bredbandsbolaget Fiber
=======> Bredbandsbolaget ADSL, VDSL
=====> Virgin.net (old NTL)
=====> Tiscali
===> Central/South American Providers
-----------------------------
Miscellaneous
-----------------------------
=> Archives
===> Announcements
=> Public Polls
===> Not on index
Print
Advanced search
Loading...
testmy.net's forum is proudly
Powered by SMF
|
SMF © 2006-2007, Simple Machines LLC
© 1999-2009 testmy.net -
Contact
-
Legal
-
Facts & FAQs
Page Loading Stats: This forum Page created in 0.104 seconds with 41 queries.