Re: [PHP-DB] SQL syntax

2013-01-15 Thread Amit Tandon
SELECT orderid FROM ORDERS_TABLE WHERE orderstatus IN ( 'Cancelled', 'New', 'Denied', 'Expired' , 'Failed' , 'Pending' , 'Refunded' , 'Reversed' , 'Under Review' , 'Voided') AND orderdate '.mysqli_real_escape_string($ yesterday); Another option would be to use

Re: [PHP-DB] Re: PDO Mysql data truncation missing error

2012-08-21 Thread Amit Tandon
Dear Matt, Even with MySQL, u get the warning as the show warnings is enabled. With php bound scripts, you have to check warnings to see the warnings. However, php is quite flexible and you an use error_reporting(E_WARNING) for non-fatal error reporting regds amit On Aug 21, 2012 10:41 AM, Matt

Re: [PHP-DB] Excel to HTML table using PHP

2012-03-21 Thread Amit Tandon
Try this linkhttp://devzone.zend.com/27/reading-and-writing-spreadsheets-with-php/. What i understand is that u do not want the end user to open the excel sheet. However, u have to read the data part and display in HTML using PHP/Javascript regds amit The difference between fiction

Re: [PHP-DB] Select from multiple tables

2012-02-29 Thread Amit Tandon
Dear Kranthi You have to be clear what you decide especially when you are getting multiple rows. To get just a single row you can use LIMIT clause. But it would return only one row. Now you have to decide which row. So i think you decide on what you require and see how can you uniquely

Re: [PHP-DB] Problem w/query - again

2012-02-09 Thread Amit Tandon
Dear Ethan It seems you are trying to build a query.But you are not getting field names. If you required field names then change the following line to foreach ( $allowed_fields AS $field = $_POST['field']) to foreach ( $allowed_fields AS $field) This would convert the variable field to value.

Re: [PHP-DB] Problem w/query - again

2012-02-09 Thread Amit Tandon
...@earthlink.netwrote: At 12:13 AM 2/10/2012, Amit Tandon wrote: Dear Ethan It seems you are trying to build a query.But you are not getting field names. If you required field names then change the following line to foreach ( $allowed_fields AS $field = $_POST['field']) to foreach

Re: [PHP-DB] Tables and foreign keys

2011-12-26 Thread Amit Tandon
regds amit The difference between fiction and reality? Fiction has to make sense. On Mon, Dec 26, 2011 at 1:55 PM, Karl DeSaulniers k...@designdrumm.comwrote: On Dec 26, 2011, at 1:57 AM, Amit Tandon wrote: Dear Karl Foreign key is a good option (provided you use InnoDB

Re: [PHP-DB] Tables and foreign keys

2011-12-26 Thread Amit Tandon
sense. On Mon, Dec 26, 2011 at 2:43 PM, Karl DeSaulniers k...@designdrumm.comwrote: On Dec 26, 2011, at 3:05 AM, Amit Tandon wrote: regds amit The difference between fiction and reality? Fiction has to make sense. On Mon, Dec 26, 2011 at 1:55 PM, Karl DeSaulniers k

Re: [PHP-DB] Tables and foreign keys

2011-12-25 Thread Amit Tandon
Dear Karl Foreign key is a good option (provided you use InnoDB database) to automate the deletion/updation of cart details when you remove cart. Besides 1:1 cardinality is good or bad can only be decided on the semantics of your tables. As a an aside, if it is 1:1 cardinality, then you can

Re: [PHP-DB] Need help with updating existing mysql records with something else

2011-11-10 Thread Amit Tandon
Dear Guru U can update the record with following === $result = mysql_query(UPDATE tax set mwool40_ totqty = $res, $connection) or die(error updating database); if (mysql_affected_rows($connection) != 1 (/* no of rows that should be updated */) { die(Update problem) ; } The only issue

Re: [PHP-DB] SELECT

2011-10-17 Thread Amit Tandon
Dear Ron If only day is required u could add another day condition in the where clause e.g. month(current_date) between and day(current_date) between. i think u require something more than this. So could u pls explain your requirement in a little more detail say what would be the output of the

Re: [PHP-DB] SELECT syntax

2011-10-12 Thread Amit Tandon
select casehttp://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html works in mysql also regds amit The difference between fiction and reality? Fiction has to make sense. On Thu, Oct 13, 2011 at 3:26 AM, Jack van Zanen j...@vanzanen.com wrote: Hi In Oracle (and maybe

Re: [PHP-DB] SELECT syntax

2011-10-12 Thread Amit Tandon
another examplehttp://mysql-tips.blogspot.com/2005/04/mysql-select-case-example.html regds amit The difference between fiction and reality? Fiction has to make sense. On Thu, Oct 13, 2011 at 9:34 AM, Amit Tandon att...@gmail.com wrote: select casehttp://dev.mysql.com/doc

Re: [PHP-DB] Learning bound variables ??

2011-08-29 Thread Amit Tandon
Dear Gevin I believe, u wish to understand about $this-... Actually this is object oriented way of writing the variable. Here this is a key word and refers to the this instance of the object. In simpler words if 2 different sessions are calling this line, then each will pass on the value of

Re: [PHP-DB] SELECT online store discount %

2011-08-22 Thread Amit Tandon
Ron Have u thought of CASE (in SELECT)http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html. Remebber their is some syntactical difference in CASE for SELECT and CASE in procedures regds amit The difference between fiction and reality? Fiction has to make sense. On

Re: [PHP-DB] Insert query error

2011-08-06 Thread Amit Tandon
Chris The error is indicated by the keywords a foreign key constraint fails, This implies that some value in store table is missing which u are trying to insert in posts. So check for the value u are trying to input in post table. U have to check for the values of post_store field from the input

Re: [PHP-DB] UNION ALL

2011-07-18 Thread Amit Tandon
Dear Ron Try this === SELECT `cross_reference_article_2` FROM `frequently_accessed_passages_of_scripture_cross_reference` WHERE `cross_reference_article_1` = 1 UNION ALL SELECT `cross_reference_article_1` FROM

Re: [PHP-DB] COUNT and OUTER JOIN results

2011-05-06 Thread Amit Tandon
Dear Ron Take your condition to ON cluause. So your on clause (for LEFT JOIN) would read something like ON `prayer_request_category`.` reference` = `prayer_requests`.`prayer_request_category_reference` AND `prayer_requests`.`approval_ level` IN ( 1, 3 ) `prayer_requests`.`prayer_request_type` =

Re: [PHP-DB] Cant Get Data

2011-02-22 Thread Amit Tandon
Dear Gary $_SESSION variable would be available only if you have session_start() at the top of the page. For $_POST, i presume u hve method POST defined for the form element regds amit The difference between fiction and reality? Fiction has to make sense. On Mon, Feb 21, 2011 at

Re: [PHP-DB] NULL values

2010-12-04 Thread Amit Tandon
Dear Ron Or try this SELECT * FROM `paypal_payment_info` WHERE ifnull(os1, '') 'commission_paid' regds amit The difference between fiction and reality? Fiction has to make sense. On Sat, Dec 4, 2010 at 7:55 AM, Ron Piggott ron.pigg...@actsministries.orgwrote: When I do the

Re: [PHP-DB] If condition in query

2010-11-18 Thread Amit Tandon
My question - 1. why have u used mysqli_fetch_array($result[0]), in place of mysqli_fetch_array($result)) i.e. without array brackets as $result is not an array. What is returned by mysqli_fetch_array is an array. 2. Have u checked the your query (print $sq1) after u added *extra test in the

Re: [PHP-DB] Is this syntax is correct?

2010-09-06 Thread Amit Tandon
SELECT d.username, r.password FROM data join registration r on r.username = d.username WHERE r.username like '%s' AND r.password like '%s' Presuming the password stored as clear text and username is common field SELECT d.username, r.password FROM data join registration r on r.username =

Re: [PHP-DB] Need Help with data sorting

2010-01-31 Thread Amit Tandon
Hello, I a not clear why are u using so many tables, and also div's within the table. Either use tableless (css tables ) or simply use table(preferably one) without divs in it regds amit The difference between fiction and reality? Fiction has to make sense. On Sun, Jan 31, 2010 at