I have Yii installed under htdocs on XAMPP and I was following Ulman’s excellent tutorial on building an app with a database. It worked flawlessly! I used MySQL as the DB. Now I know Sqlite is the default DB for Yii but I used MySQL. I have a hosted account with Godaddy and they use MySQL. But they don’t use LOCALHOST as the Hostname. They use a character stream that is about 25 or 30 characters long and it’s different for each database. I generally just use one of the 25 I’m allowed and just created different tables off it. I want to upload my whole project to my hosted account and put it in a folder off root. Will the whole thing work after I do that if I just recreate the two tables(with column names) on my online database and change the hostname to godaddy’s furnished hostname?
[2] one other question. Is Sqlite self contained? That is is everything, including sqlite’s dlls within the Yii structure, or would I have to use Godaddy’s Sqlite?
Forgot to say I using latest version(not 2) of Yii and I am running under Win 7
Latter one. There’s a high chance for some kind of incompatibility between your local SQLite and GoDaddy’s. Not to mention the hassles you’ll most likely go through to get your dll loaded …
Oh OK I see. I not using the windows server on Godaddy I’m using Linux. My Developing machine is windows is all. I am in the process of trying it out now. Will let you know, although I probably will other problems
Ok I tried it out. It didn’t work because it says it can’t find the $view. Can you take a look at it please. The same setup worked fine when on my computer.
OK thanks! There isn’t one! in fact there are no files at all in that folder although they are in the one on my computer. This FTP(Filezilla) has been acting up lately and must not have uploaded all the files. I will try again with another FTP client and see if I can get it straightened out. Will keep you informed so please don’t unsubscribe!
OH That’s a feature of some forums that so that when a reply is posted you will get an email. Any way, I tried again with a fresh install of ulman and yii folders. No luck again ! Please go the the Url and look at the error page. This time it tells me that there is no connection string or database name. I checked with FTP Clint Editor and everything is correct in /protected/config/main.php. I try to keep everything in lowercase if possible, for conformity if nothing else except that the password has to be one uppercase letter and a number. I checked the password and that is entered correctly.
Well I have examined the error msg and the connection string closely. apparently, it’s choking on the Data Source name, which I assume is the Database name. Now I use this connection repeatedly in other apps like Wordpress and PHPbb. I looked at the connection string and examined it character by character and it is correct, as well as the Data source name. I noticed that the generated protected/config/main.php file had spaces on each side of the ‘=>’ and removed them, thinking that might be the problem, but it wasn’t.
Anyway, here is the connection string and connection particulars:
'db'=>array(
'connectionString'=>'ph9228762.db.4920380.hostedresource.com;dbname=ph9228762',
'emulatePrepare'=>true,
'username'=>'ph9228762',
'password'=>'Xxxxxxx92', //Not the real password
'charset'=>'utf8',
),
Your right. That fixed it! However there is another little problem No matter what I put in the hire date it just comes up with all zeros. Is this a bug? according to the SQL in the tutorial, hire and leave date or both of type time/date stamp.
[2] Where does the connectionstring come from. Do I have to get that from my provider or is it generated by yii?
Timestamp and datetime fields require a certain input syntax. Are you following this tutorial? Because I cannot spot anything that would hint at input validation.
Yes, but I hadn’t got to part 6 yet. It seems that Yii does generate the Connection string and it was correct originally for godaddy. I tried to put it on another server and changed the connection string I guess and didn’t change it back.
In the Date fields the input box looks like this:0000-00-00 00:00:0
This looks like the european style to me with the year first. I hadn’t tried that way. What I did was like this 10/23/2013 and 10-23-2013 (American Style) It didn’t say it was wrong, just didn’t put anything in the column, so I guess their is no validation. Is there a way to turn that on? Is it a feature of Yii?
Well I see that if nothing is there in the hired line Yii will flag it, but the actual pattern has to be in the format that MySQL requires or it doesn’t put anything there.