cfarm
-
Posts
6 -
Joined
-
Last visited
Posts posted by cfarm
-
-
Ok I think I figured out what was wrong with the root dir. There was another folder that was storing the includes. Silly me.
As for the mysqli, I'm still not sure what's going wrong here. Do you think it's reasonable to move from mysqli to mysql? I've been trying to figure out what the cause to this might be for a while now and am starting to wonder if it's even worth the trouble. Here is the error that the code is generating:
An error occurred in script '/Applications/MAMP/htdocs/mysql.inc.php' on line 16: mysqli_connect() [function.mysqli-connect]: (HY000/2003): Can't connect to MySQL server on 'localhost:8888' (60)
-
Yes I am using a mac and have tried setting to '/Applications/MAMP/htdocs/'. For some reason it's still not working.
As for mysqli I'm using PHP5 with mysql v 5.1x so I should be fine with the versions. I think there is probably some setting that I'm missing in the config file for apache. Would you happen to know what this could be?
mysqli
MysqlI Support enabled
Client API library version 5.1.44
Active Persistent Links 0
Inactive Persistent Links 0
Active Links 0
Client API header version 5.1.44
MYSQLI_SOCKET /Applications/MAMP/tmp/mysql/mysql.sock
Directive Local Value Master Value
mysqli.allow_local_infile On On
mysqli.allow_persistent On On
mysqli.default_host no value no value
mysqli.default_port 3306 3306
mysqli.default_pw no value no value
mysqli.default_socket no value no value
mysqli.default_user no value no value
mysqli.max_links Unlimited Unlimited
mysqli.max_persistent Unlimited Unlimited
mysqli.reconnect Off Off
Thanks!
-
Hi I'm going through EX1 and I've come up with two errors so far.
The first error has to do with mysqli. I tried using mysqli_connect then mysql_connect and things are only working for mysql_connect. Is there a reason why it's not working for mysqli?
The second is that I'm getting an error on the require statement on line 15 of index.php. See error below
An error occurred in script '/Applications/MAMP/htdocs/ex1/html/index.php' on line 15:
require(/ex1/mysql.inc.php) [function.require]: failed to open stream: No such file or directory
Is there a reason for this?
Thanks!
-
Yes thanks for the help. I've been looking for some documentation on
UNIQUE KEY
but haven't found any. Do you know where I would be able to look?
-
Why do you have two keys in the categories declaration on page 51 for your categories table? And also what is the difference between a primary and unique key?
CREATE TABLE categories( id SMALLINT NOT NULL AUTO INCREMENT, category VARCHAR(30) NOT NULL, PRIMARY KEY ('id'), UNIQUE KEY 'category' ('category') )
Mysqli Not Working
in Effortless E-Commerce with PHP and MySQL
Posted
Ok I think I got it working. I rebooted the server and seems to work fine now.