New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

MySql And Other Questions


Post Reply New Thread Subscribe

 
Thread Tools
bwilliamson0019

 
Member Since: Feb 05, 2005
Posts: 15
bwilliamson0019 is on a distinguished road
Mac Specs: 12 inch ibook 1.2 ghz

bwilliamson0019 is offline
I've installed the php packace from entropy.com, and mysql v.4.1.
i cant seem to get php to talk to mysql.
php scripts work fine on their own.
php my admin works in mysql, but any db::connect(mysqli://@@) script with a
"if (DB::isError($db)) {die("Can't Connect:" . $db->getMessage()); }"
gives me a blank page?
Also is there any way to access /usr/local/ in the finder?

thanks
QUOTE Thanks
lil
Guest
 
Posts: n/a

Hiya,

Short answer before bed for me...

However I have not ever used PHP in that way to connect to a MySQL database - is this the way you have done it before or are you just starting out with PHP/MySQL.

Only thing that does strike me is if(DB::isError($db... should that be if(db::isError($db...

The way I have always done it and has worked has been:

--
$db = mysql_connect('localhost','some_user','password');

$db_select=mysql_select_db('database_I_want');

if(!$db || !$db_select)
{
echo 'Could not connect to database. Please try again later.';
exit;
}

// we connected all ok
---

That has never given me issues on PHP/MySQL; and I am pretty sure this is with MySQL 4.1 too.

Is this the first time you have installed PHP and MySQL on your Mac? Has it worked before? What system did you use before if you are an experienced PHP/MySQL programmer and what versions?

Then we can make some headway to getting solutions

Unfortunately the only way to access /bin /etc /usr etc is though terminal. Whether enabling the superuser account will avail them in Finder I do not know; personally I stick to the terminal with sudo.

Vicky
QUOTE Thanks
bwilliamson0019

 
Member Since: Feb 05, 2005
Posts: 15
bwilliamson0019 is on a distinguished road
Mac Specs: 12 inch ibook 1.2 ghz

bwilliamson0019 is offline
thanks for the answer.
That skript worked for me on my xp box. (php 5.03 mysql4.1)
(book - learning php5 - O'reillly)
I am not an expert php programer, but i have done a site.
I dont know unix at all, but i can get around on osx.
I know on xp i had to load a dll file For mysqli comands.
can i acess php.ini (or something similar) in osx?
QUOTE Thanks
steveedge
Guest
 
Posts: n/a

Are you logged in as root user ? Did you install as root user / This may be a permission problem. make sure root is enabled and you are logged in as root.

Secondly, if you have or can get "BB Edit" you can access usr/local (and other hidden files) in BB Edit. They open up just like any other text file.
Using BB Edit for me is faster than terminal. I was never great with those Unix commands.
Good Luck,
QUOTE Thanks
muso

 
muso's Avatar
 
Member Since: Jan 15, 2003
Location: Whangarei, New Zealand
Posts: 2
muso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond reputemuso has a reputation beyond repute
Mac Specs: Pwnt

muso is offline
Type in command-shift-g and you'll be able to type /usr/local and have that directory appear on screen.

I'm in your forums, writing sentences in a grammatically acceptable manner.
QUOTE Thanks

Post Reply New Thread Subscribe


« paypal | FTP activity trigger applescript to email? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 01:01 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?