Questions tagged as 'php'

1
answer

Is it possible to change a word from one string to another in the database through php?

I've been working on a method that will fetch all dates that contain "2014" and replace that value with "2016" without changing the rest of the date. I have already been able to return all the columns that contain "2014" but I do not know how to...
asked by 12.05.2015 / 12:14
2
answers

How to separate array in odd / even and calculate multiple number?

I'm doing a script to separate odd number and even number from a array entered via form option, and make specific calculation about them (to separate odd number from pair array am using explode and implode to put th...
asked by 09.05.2015 / 07:53
1
answer

Error in a SQL query in PHP [duplicate]

I am having difficulties with a SQL query in PHP, when I make a query I get the following error:    Warning: mysqli_fetch_assoc () expects parameter 1 to be mysqli_result, boolean given in C: \ xampp \ htdocs \ trabalhowebGustavo \ user \ B...
asked by 24.05.2015 / 20:17
4
answers

Multiplying values within a for

To using the for to generate a loop of 4 reps! Inside this loop I make a very simple numerical multiplication. <?php echo "Resultado: "; for($loop = 1; $loop <= 4; $loop += 1) { echo ($loop * 10)." ";...
asked by 30.05.2015 / 23:13
2
answers

Inserting HTML blocks into HTML document using PHP

I have an HTML interface that should render query results in the database (PHP + PDO (MYSQL)) how do I inject the results dynamically on the (pure) HTML screen? since the queries vary from user to user (one can consult "Tennis" another "dog")....
asked by 21.01.2015 / 12:42
1
answer

How to return more than one column from the same table?

With this SQL I can in my database select and group products by variations that would in this case be different attributes for the same product. So, when generating the view of the product, I have a dropdown in the product with all the attrib...
asked by 26.11.2014 / 17:22
2
answers

Remove the original image from the server after Wordpress generates the thumbnails

I need to remove the original image that gives rise to Wordpress thumbnails after the thumbnails are generated. I have 3 sizes of thumbs that I use, however to prevent the server from getting unnecessary files I need to remove the original, whic...
asked by 01.12.2014 / 14:44
1
answer

How to browse and compare two arrays in PHP

I have two arrays that return a MySQL query. I need to compare these two results so that, each time they are different, they print something on the screen. The problem is that the query that comes back from the database is an array with several...
asked by 21.11.2014 / 02:16
1
answer

Extend new CI class

I have the following code: class MY_Controller extends CI_Controller { function __construct() { parent::__construct(); } } I need to build a class where I do the CI_Controller extension, so I do not have to "repeat" functi...
asked by 20.07.2015 / 21:45
2
answers

Difficulty creating sessions to save form data

I have a form that has 6 fields and a button that allows the user to repeat these 6 fields to add more data. I want to save the data in a session, and write to DB only when the user completes the fill. I do not know how to create the sessi...
asked by 28.07.2015 / 19:12