Skip to content

Tag: php

How to merge static and dynamic forms together in php?

The my project has two forms. The first one is a static form that is used to collect user information (Form One inserts data into a table named, master). Second form is a dynamic form which collects additional information such as dependents (Form Two inserts data into a table named, dependents). formone.php c…

a PHPpunit test fail randomly

I have a Quiz class. This class load 10 questions from a database depending on the level and the type of the quiz Object: level 0 load the ten first, level 1 load the next ten and so on. So in my test i create in a test database 30 questions. Then i create quiz object with different level and

How to call PHP function using Ajax (Javascript, PHP and Yii1.1)

I am looking to call a PHP function through an onclick event. The PHP action within the controller then should start a download for a json File containing the needed data. I already know ajax and I am using it currently but somehow the function does not fire. I am 100% certain that I am doing something wrong,…

I keep getting a warning when I put an array in a foreach loop

Here is my code. It gives me a warning when I use line 3 of my code. The $object passed in the parameter is a json object and I am trying to for loop through it and display tweets. The code at first doesn’t produce warnings but then out of no where it will and it pops my page with

DataTables can’t read more than one Data

I would like to ask why is the DataTable can’t read more than 1 data in my Database? I would appreciate any help since I’m relatively new with the Data Table, thank you. As you can see it’s only showing 1 to 1 of 1 entries. But as seen in the table I have 5 retrieved data. and when I

Putting php arrays into html tags

I am trying to make a table that has different colors for each of its columns. There will be four columns. $colors = array(“background-color:red;”, “background-color:gold&…