MySql And Other Questions

Joined
Feb 5, 2005
Messages
15
Reaction score
0
Points
1
Your Mac's Specs
12 inch ibook 1.2 ghz
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
 
L

lil

Guest
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
 
OP
B
Joined
Feb 5, 2005
Messages
15
Reaction score
0
Points
1
Your Mac's Specs
12 inch ibook 1.2 ghz
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?
 
S

steveedge

Guest
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,
 
Joined
Jan 15, 2003
Messages
4
Reaction score
16
Points
3
Location
Whangarei, New Zealand
Your Mac's Specs
Pwnt
Type in command-shift-g and you'll be able to type /usr/local and have that directory appear on screen.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top