Configuration for use with MAMP

QuestionsConfiguration for use with MAMP
Michael Bawden asked 11 years ago

Hello, I am struggling to get the demos to work. Although I've changed the localhost to localhost:8889 and added the correct password and the database griddemo has been created and filled with data when I run the demo index.php I always get "Couldn't excecute query. No database selected " and then a select statement. When I look at the code the $conn seems to be correct and the mysql select db is griddemo. What am I doing wrong?

5 Answers
Chao Shun Jenq answered 11 years ago

Hi,

maybe you can check the firewall first for port 8889.

Rgds,

Abu Ghufran answered 11 years ago

Check using a testing php file, if DB connection is successful or not.

This link will help in testing code: http:/us3.php.net/mysql_connect

Also let me know which php version are you using.

Michael Bawden answered 11 years ago

Hello Abu, I'm using version 5.3.5 of php and I can connect to all my databases and php code I've written over the years just fine. I haven't looked to see if there is a way to test for a failed connection in your framework yet but I will sometime this week.

Cheers
Mike

Michael Bawden answered 11 years ago

When I put in my sql username and password do I only do it in the index.php file in the demo folder or is there another file I need to change?
Cheers
Mike

Abu Ghufran answered 11 years ago

Each demo have separate connection setting above the code.

for e.g.
demos/editing/index.php
demos/master-detail/master-detial.php

Both have seperate connection on top.

Your Answer

9 + 20 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?