[Solved] adddate(curdate(), -(day(curdate())-1)) and concat(last_day(curdate()),’ 23:59:59′) [closed]

DAY(CURDATE())-1 is the current day of the month, less 1. For today (Aug 15, 2013), the value would be 14. Subtract 14 days from August 15 and you have August 1. In other words, ADDDATE(CURDATE(), -(DAY(CURDATE())-1)) gives you the first day of the month. LAST_DAY(CURDATE()) gives you the last day of the month. If you … Read more

[Solved] How to get the value which user has selected in php?

<?php if($_POST[‘select’]){ // Storing selected value in a variable $selectedValue= $_POST[‘holiday’]; if ($selectedValue == ‘month’) { } else if ($selectedValue == ‘day’) { } else{ echo “Lalalala”; } } ?> solved How to get the value which user has selected in php?

[Solved] compare two table with row and column

Try: SELECT * FROM table1 WHERE folio = ‘123456’ AND cm_flag !=’X’ AND certificate_no NOT IN (SELECT CONCAT(certno1,’,’,certno2,’,’,certno3,’,’,certno4,’,’,certno5,’,’,certno6,’,’,certno7,’,’,certno8,’,’,certno9,’,’,certno10) FROM table2 WHERE tofolio = ‘123456’) 1 solved compare two table with row and column

[Solved] MySQL INJECTION Solution

Reinventing the wheel and reinventing it the Wrong Way (TM). First of all, there are parametrized queries (available for PHP in MySQLi extension); if that’s not an option, there’s mysql_real_escape_string. This is the main issue – check for already available options before deciding to implement them on your own. Second, you are trying to call … Read more

[Solved] fetch the result based on the user postalcode [closed]

Fetch the latitude and longitude of user postal code by using this url example: http://maps.googleapis.com/maps/api/geocode/json?address=canada&components=postal_code:<user_postalcode>&sensor=false Then fetch the result using the below query SELECT Shop, latitude, longitude, ( 6371 * acos( cos( radians($lat) ) * cos( radians( latitude ) ) * cos( radians( longitude ) – radians($lng ) ) + sin( radians($lat) ) * sin( … Read more

[Solved] UPDATE syntax error for SET WHERE LIKE

UPDATE `isc_products` SET `prodretailprice`=145 WHERE `prodcode` LIKE ‘TSACR3’ Enclose the search pattern in single quotes. LIKE syntax: http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like LIKE can be used with the following wildcard characters % Matches 0 or more characters. E.g. LIKE ‘TSACR3%’ will match TSACR3 bla blah _ Matches exactly one character. E.g. LIKE ‘_TSACR3’ will match 2TSACR3 but NOT 42TSACR3 … Read more

[Solved] Cant locate SQL syntax error in basic email tracking pixel [closed]

You appear to have an extra comma at the end: INSERT INTO email_table VALUES (‘$CAMPAIGN’, ‘$IP’,) Try: INSERT INTO email_table VALUES (‘$CAMPAIGN’, ‘$IP’) BTW, I won’t judge your code too much but tracking people by IP is not very reliable. For example, a lot of corporate traffic behind company firewalls can use the same IP … Read more

[Solved] INSERT statement does not work [closed]

“condition” is a MySQL reserved word. If you have to use it as a column name wrap it in backticks (`) EDIT And escape any strings that you’re planning on storing in the database. That allows the db to handle quotes (‘) in the actual string itself. As suggested by Joop, using prepared statements avoids … Read more

[Solved] Thank you for helping [closed]

actually this is not good practice to insert the value in the database. i recommend always use something like this. $sqlQ=”insert into users (tableField,tableField1) values (‘$value’,’$value1′)”; Note:never put auto increment field name OR value in the query.and always use prepared statements to avoid sql injection attack.given code is also vulnerable.if you do not know about … Read more

[Solved] What Is Active db in CodeIgniter? [closed]

I think it’s Active Record not Active DB. Active Record is a One kind of design pattern used for retrieve, insert, and update your database with minimal scripting. You will find more about this in the bellow link https://www.codeigniter.com/userguide2/database/active_record.html 1 solved What Is Active db in CodeIgniter? [closed]