I’ve been developing in Yii for a couple of days now, and my website is looking good for a January 28th release. The beta is ready and can be visited here: tasta.be/tasta (it’s all sample data, we won’t be using GiantBombs videos, no worries! ).
That being said, I have a weird problem where it works perfectly on my localhost, but doesn’t work on my server. It’s regarding a check if a certain value is 0 or 1. In my database, I have defined the column as BIT(1).
When you visit tasta.be/tasta/index.php?r=games/view&id=2 for instance, underneath the description (which ends with "Reclaimer Trilogy") there should be a span, because in my view.php method, I do this:
<?php if($model->playstation3 == '1') echo '<span class="playstation3 label">PlayStation 3</span>'; ?> <?php if($model->xbox360 == '1') echo '<span class="xbox label">Xbox 360</span>'; ?> <?php if($model->pc == '1') echo '<span class="pc label">PC</span>'; ?>
This works fine locally, as I said. You can see here: 3675
I personally don’t think the problem lies in the span syntax, or the problem lies in the view file at all. The same problem happens in my videos view file, so it’s not a singular view file problem.
Why I think that? Because when I try to update a game (as admin), all the checkboxes are unticked (even though in the database it has the correct values). So even when in the database all platforms are set to 1, I see:
On localhost, the boxes are correctly ticked when theres a 1 value in the database. Also in the games management screen on the server, it seems like there are no values 3676
In localhost, again, it displays correctly: 3677
I have two extra things to add:
Code is 100% the same.
(Server) Even though checboxes ‘reset’ visually, when I update the game and check some boxes, the changes are correctly saved in the database.
I’m puzzled. I don’t know where to start looking. So any help whatsoever would be really great!