Hi all
I have a php program accessing a mysql database. I want users to be able to run reports via the program. But I also want to export the results of my query to excel by clicking on a push button present on my screen. Is there any function which can do the export to excel format. I would be grateful if anyone could provide me this info.
Thanks
User Profile
Collapse
-
exporting a mysql table to excel format via a php program
-
setting a filter on dates
Hi all
can you please tell me what is wrong in the where clause of this sql query; filterstr and filterstrtwo are date fields and filterfield is the date field on which i want to set filter e.g where issue date between '2007-01-01' and '2008-01-01'. I am not getting any syntax error but the filter is not working
[PHP]$sql = "select `Bkg_SerialNo`, `Bkg_FileNo`, `Bkg_Ent_Name`, ` from `guarantee`";
... -
Hi
Is there something wrong with the code below. I've tried the solution you proposed but it is not working. If the variable $add is not equal to one and the renewal date contains a value then only should the textbox for the renewal date be displayed otherwise if add==1 or if the renewal date does not contain any value the textbox to edit the renewal date should not be displayed
[PHP]
some other codes... -
or condition in an ifelse statement
Hi all
I want to specify an OR condition in an if statement. Can anyone please tell me how this can be done.
I've tried this but it does not work
[PHP]<? if (($add!=1) or (!empty($row["Bkg_Renewal_Dt "])))
{
echo '<tr>';
echo '<td class="hr">';ec ho htmlspecialchar s("Renewal Date")." " ;echo '</td>';?>
<td class="dr"><inp ut... -
Sorry but i am a newbie and don't know javascript. Is there no other way.Leave a comment:
-
Sharing variables between functions
Hi all
It's me again.. I have a variable to which i am assigning a value in one function. I have to use the variable with the same value assigned in another function. How can I do this. I've tried to portray this in the following codes
Thanks.
[PHP]Function x
{
$a =25
}
Function y
{
If ($a=25)
sql_insert();
}[/PHP] -
conditional posting of a record
Hi all
I would be grateful if you could help me in the following issue. I have a form on which I can recall records and modify them. On clicking on the push button 'post', the modified record is updated and a page called guarantee.php is called. But now I want to add some validation so that if there's a mistake in an input field e.g. 'tan' the message 'invalid input' is displayed and instead of calling the program guarantee.php, I... -
-
Thanks Sumaabey
It works. I need some more help. How do I use php to convert the date which is displayed as '26-6-2007 11:21:10' in the format '2007-6-26' to be stored in mysql database.
Thanks againLeave a comment:
-
I am coding in php and do not have any knowledge of javascript. Could you please tell me what is meant by 'document.frmca mpaign.txt frmdate' and document.frmcam paign.txtfrmdat e.value because when I tried to run the script I got an error on these two items. In fact I have to store the value from the calendar in a field called 'Issue_Dt'.
ThanksLeave a comment:
-
displaying a calendar to input dates
Hi all
I want to display a calendar so that users can select the date from it to be input in a date field called 'issue date' in my database. Grateful if anyone could let me know how this can be done.
Thanks -
Is it possible to specify the date format (e.g 26/06/2007) in the mysql database itself instead of converting it via php.
Another question : I want also to specify the format of a numeric field (999,999,999,99 9) in the database itself so that all numbers input get this format.
Thanks againLeave a comment:
-
Current date as the default value of a date field
Hi all
It's me again. I now want to specify the current date in the format '26/06/2007' ie date/month/year as the default value in my mysql database. Which implies that by default the value of my date field in the database should be the current date. How can I do this in the Mysql database itself, so that each time my application is called the current date appears by default.
Thanks in advance for your replies -
Conditional display of an item
Hi All
Thanks for the replies to my previous questions. I have some code down there to enable editing of a field called 'Usr_Surname' if the value of the variable 'authorise' is one . If the variable authorise is any other value than one I want to display the field 'Usr_Surname' without allowing users to edit it. The code is not working. I need some help. Thanks
[PHP]</tr>
<tr>
<td class="hr"><?... -
getting the current date assigned to a database field
Hi all
I want to save the current date in a database field in the following format dd/mm/yyyy for example 18/06/2007. How can i do this. The following is code I've used to assign nulls to my values but the value Bkg_created_dat e should contain the current date in the format mentioned above . I've tried to insert lines code as in lined 13,14,15 but it does not work
[PHP]<?
$row = array(
"Bkg_Serial No"... -
[PHP]
<? function showroweditor($ row)
{
global $conn;
?>
<table class="tbl" border="0" cellspacing="1" cellpadding="5" width="50%">
<tr>
<td class="hr"><? echo htmlspecialchar s("User Id")." " ?></td>
<td class="dr"><inp ut type="text" name="Usr_Id"...Leave a comment:
-
Hi ajaxrand
Part of the code which makes the drop down list in my program is shown below
<?php
....some codes here
<tr>
<td class="hr"><? echo htmlspecialchar s("Status")."&n bsp;" ?></td>
<td class="dr"><SEL ECT name=”Usr_Statu s”>
<option value="Active"> Active</option>
...Leave a comment:
-
Inserting a value from a drop down list into a mysql database
Hi All
I wish to use a drop down list with the values 'Active' and 'Inactive' and select one of those values to go into my table 'users' which has a field called 'status'. I do not want to store the values 'Active' and 'Inactive' into another table but I want to use them from the list directly. In fact I have been able to build the drop down list but I am unable to insert it into the table 'users'. Could anyone please tell me how this... -
MySQL SHA1 and PHP don't give same result
Hi all
I am using the sha1() function to encrypt my password in mysql database. Also when entering the password in my php login script I am using the same function to verify the password against my database. But the two passwords are not matching. In fact the user password in the database is '8ed3a6b96bec29 00' but the password obtained after applying the sha1 function to the same password string is returning '8ed3a6b96bec29 0020f1eb145f51a 41d4a2e008e'... -
Syntax error when using Password function in php and mysql
I have the following code in my script and it's giving a syntax error at line *** when using the password function. My password in the mysql database is encrypted using the password function itself and I want to verify the input password against my database password. PLEASE HELP
[code=php]
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "")...
No activity results to display
Show More
Leave a comment: