OK Now I am trying to generate a report (excel file), so I have two inputs Type and when I click on PHP generates the file, but I have not received any errors, because no record was found, why? The name of the column in my database for the date is the order_time and the data type is datat so that the format of the format: - 2014-02-18 05: 25: 38 like this? So my main problem is how can I work together, I think the SQL statement will work on it, but how can I confuse it and I also know that I would declare such a variable But how am I confused, the help would be appreciated Alot :) Below is a link to the full code of php. I'm just using for reference and also down there is a small code of what I am doing.
$ con = mysql_connect ( 'localhost', 'root', ''); Mysql_select_db ('ProjectDatabase12345', $ thief); $ Order_time = $ _ post ["datefrom"]; $ Order_time = $ _ post ["dateto"]; $ Query = "SELECT * fROM ss_orders where order_time = '" $ order_time "'Border 60' '$ header =' '; $ data =' '; $ export = mysql_query ($ query) or die (" Sql error: ". Mysql_error ()); $ Fields = mysql_num_fields ($ export); ( $ I = 0; $ i ++) {$ headers. = "MySql_field_name" ($ export, $ i) for "\ T";} while ($ line = mysql_fetch_row ($ export)) {$ Line = ''; foreign currency (as the $ line $ value) {if (((! (Isset ($ value)) $ $ ($ value == "")) {$ value = "\ t" ;} And {$ value = str_replace ('' ',' "" ', $ value); $ value =' '' $ value '$'. = $ Value;} $ data. = Trim ($ line). " \ N ";} $ data = str_replace (" \ r "," ", $ data) ;; ($ data ==" ") {$ data =" \ nNo record found! \ N ";} Header ( "Sa Header ("Content-Dispute: Header (" Expire: 0 "); Print" $ Header \ n $ Data ";
2014-02-18 05:25:38 There is a very specific time for the query. You are only using one of your Variables. Maybe you mean something like this:
$ $ = $ _ POST ["datefrom"]; $$ = $ _ POST ["data"]; From Alex ss_orders where order_time & gt; = '' $ From '' And order_time & lt; = ''. $ From '60 limit' '
In addition, switch to Mysqli or PDO and clear those inputs. If this is a publicly you can subject yourself to SQL injection. Mysql_functions are disliked.
Comments
Post a Comment