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 e

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 link. 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 ficti

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 identify

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

2012-02-09 Thread Amit Tandon
e." On Fri, Feb 10, 2012 at 11:04 AM, Ethan Rosenberg wrote: > 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 t

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. I

Re: [PHP-DB] Tables and foreign keys

2011-12-26 Thread Amit Tandon
tion has to make sense." On Mon, Dec 26, 2011 at 2:43 PM, Karl DeSaulniers wrote: > > On Dec 26, 2011, at 3:05 AM, Amit Tandon wrote: > > >> regds >> amit >> >> "The difference between fiction and reality? Fiction has to make sense.&qu

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 wrote: > On Dec 26, 2011, at 1:57 AM, Amit Tandon wrote: > > Dear Karl >> >> Foreign key is a good option (provi

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 prob

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

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 que

Re: [PHP-DB] SELECT syntax

2011-10-12 Thread Amit Tandon
another example<http://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 wrote: > select > case<http://dev.my

Re: [PHP-DB] SELECT syntax

2011-10-12 Thread Amit Tandon
select case 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 wrote: > Hi > > In Oracle (and maybe others) you

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). 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."

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 i

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 `frequently_accessed_passages_of_scripture_cr

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 wrote: > > When I do the following query in mySQL on

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 que

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 = d.u

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 a