Jump to content

Phpnewbie23

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Everything posted by Phpnewbie23

  1. Sorry. I dont understand your example or are we on the 2 seperate paths. I already have the time stamps which are populated by the database the start time BACKUP_START_TIME and the end time BACKUP_END_TIME "see image attached" And instead of: Start time End Time 1227142806 1227147684 I planned to have: Start Time End Time Thursday, November 20th 2008, 1:00:06 (GMT) Thursday, November 20th 2008, 2:21:24 (GMT) or maybe trimmed down abit. Cheers [attachment deleted by admin]
  2. I am trying to work out how to get my time changed from UNIX to user readable time. $start_time=odbc_result($rs,"BACKUP_START_TIME"); $end_time=odbc_result($rs,"BACKUP_END_TIME"); The above gets the start and the end time from the database. The below code puts the data in a table along with other data. echo "<td align=center><small>$start_time</small></td>","\n"; echo "<td align=center><small>$end_time</small></td>","\n"; I was just after a little help on how to change the BACKUP_START_TIME also the BACKUP_END_TIME to a readable date format i have been looking at it for most of the day now ??? ??? ??? ??? Cheers
  3. Worked out how to change the font colour ;D ;D nows its just the UNIX time stamp. :o :o Cheers
  4. Cheers had the bracket in my original code but moving it where you suggested worked brilliantly cheers its taken me nearly all day to figure that one out. ;D ;D How would you do the colouring of the text for success or fail. Cheers
  5. Cheers had the bracket in my original code but moving it where you suggested worked brilliantly cheers its taken me nearly all day to figure that one out. ;D ;D How would you do the colouring of the text for success or fail. Cheers
  6. I am having a issue with a php function. What i am trying to do is populate a table using a ODBC_fetch_row. Here is the code: echo "<table width=60% height=3% cellspacing='1' cellpadding='2' border='1'>"; echo "<tr>"; echo "<th align=center><small>Client</small</th>"; echo "<th align=center><small>Backup Name</small></th>"; echo "<th align=center><small>Start Time</small></th>"; echo "<th align=center><small>End Time</small></th>"; echo "<th align=center><small>Backup Status</small></th>"; echo "</tr>"; //echo "</table>"; while (odbc_fetch_row($rs)) { $client=odbc_result($rs,"CLIENT_NAME"); $backupname=odbc_result($rs,"BACKUP_NAME"); $start_time=odbc_result($rs,"BACKUP_START_TIME"); $end_time=odbc_result($rs,"BACKUP_END_TIME"); $remarks=odbc_result($rs,"REMARKS"); //echo "<table width=60% height=5% cellspacing='1' cellpadding='2' border='1'>"; echo "<tr>"; echo "<td align=center><small>$client</small></td>","\n"; echo "<td align=center><small>$backupname</small></td>","\n"; echo "<td align=center><small>$start_time</small></td>","\n"; echo "<td align=center><small>$end_time</small></td>","\n"; echo "<td align=center><small>$remarks</small></td>","\n"; echo "</tr>"; echo "</table>"; and the result i am getting is see attached image. What i would like to do is have the results in table. Like the first row in the image with $remarks to green if success and red if say SG0000 out of space. I also would like to sort out the time change it from UNIX to windows time and some other stuff but that can been later. Cheers [attachment deleted by admin]
  7. sgserver.db is the sqlite database where the backup details are stored vembu advise to connect through ODBC. A batch file moves the sgserver.db from its orignal location to the c:\vembureport\ as it can corrupt the backup if 2 programs talk to the database at once.
  8. Right got that working in a way ;D ;D I am now getting this error. PHP Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database in C:\Inetpub\wwwroot\BackupReport\BackupReport.php on line 74 PHP Warning: sqlite_query() expects parameter 1 to be resource, string given in C:\Inetpub\wwwroot\BackupReport\BackupReport.php on line 82 PHP Warning: sqlite_num_rows() expects parameter 1 to be resource, null given in C:\Inetpub\wwwroot\BackupReport\BackupReport.php on line 86
  9. I dont know how to, i cannot find a walk through. The objective i am trying to achieve is a backup moniter showing all the clients and if they failed, didnt run was a success what the total back up size was ect and show this month by month. Then hopefully write it to a excel file some how......... For example Date: 1st 2nd 3rd 4th 5th 6th 7th 8th 9th c S F M F S F l i e n t s Hope this helps Cheers
  10. We have a anthor application that works off a sqlite database. It generate a reports for all our clients we have. I have to manaully log them in excel for everyone to look at. I wanted to create a web page whereit pulls the data out of the sqlite database. The software manaufractors advise to use ODBC connection. I am very new to PHP and have been wanting to learn it for a long time. Here is my code: <?php // Database connector $dbconn=sqlite_open('c:\VembuReport\sgserver.db', 0666, $sqliteerror); // Generate querey string $query="SELECT BACKUP_NAME FROM INCREMENTAL_BACKUP_REPORT"; // execute query // return result object $result=sqlite_query($dbconn, $query); // if rows exist if (sqlite_num_rows($result) >0) { //get each row as an array //print values ->fetch() echo"<table cellpadding=10 border=1>"; while($result->fetch) { echo "<tr>"; echo "<td>".$row[0]."</td>"; echo "<td>".$row[1]."</td>"; echo "<td>".$row[2]."</td>"; } echo "</table>"; } ?> It fails on the sqlite_open command with "PHP Fatal error: Call to undefined function sqlite_open() in C:\Inetpub\wwwroot\BackupReport\BackupReport.php on line 74 " I really want to make this web application happen and to add php string to my bow. do i have to install anything or amend anything in the PHP.ini
  11. Looking at php.net can i use the sqlite functions with the ODBC functions this is my code it is suppost to populate a table with Backup_Name. <?php // Database connector $conn=odbc_connect('VembuDSN', '', ''); // Generate querey string $query="SELECT BACKUP_NAME FROM INCREMENTAL_BACKUP_REPORT"; $res=odbc_exec($conn,$query); // execute query // return result object $result=odbc_result($res); //$conn->query($query); //or die("Error in query"); // if rows exist if ($result->odbc_num_rows() >0) { //get each row as an array //print values echo"<table cellpadding=10 border=1>"; while($row=$result->fetch()) { echo "<tr>"; echo "<td>".$row[0]."</td>"; echo "<td>".$row[1]."</td>"; echo "<td>".$row[2]."</td>"; } echo "</table>"; } ?> Cheers
  12. Is there any other way to connect to a sqlite database other than ODBC. Cheers
  13. I will track down one i am new to Php and i would liked to code it myself. But i lookup your suggestion cheers
  14. Sorry Cooldude832 could explain what you said please what do you mean by use logical statements on each itteration of the loop to verify that you are in the same month if not add a new heading etc. Cheers
  15. Brilliant cheers guys now all i have do now is get them into a table across the screen. Also only show December when its December and January when its January. Cheers
  16. Hi there I am new to PHP and i would like to populate a table using the date function. For example: 1st Dec 2008 2nd Dec 2008 3rd Dec 2008 and so on but when January comes around change to January. 1st Jan 2009 2nd Jan 2009 3rd Jan 2009. Hopefully that made sence i am struggling on how to start the code. Cheers James
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.