Re: [PHP-DB] Number Conversion
number_format(): http://ca.php.net/manual/en/function.number-format.php On Thu, 2002-10-17 at 14:52, Manoj Japher wrote: hi, I would like to format my output. I would like to represent my integer outputs as 2,000 instead of 2000 which it prints by default. For e.g. I want 200 to be printed as 2,000,000 Do we have any functions which does that? Thanks in advance, Best Regards, Manoj Life,it is not a problem to be solved, but a process to be managed. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP-DB] Number Conversion
hi, thanks ryan, marco and matias for your quick response. Solved my problem. Thanks once again. Best Regards, Manoj On Fri, 18 Oct 2002 Marco Tabini wrote : number_format(): http://ca.php.net/manual/en/function.number-format.php On Thu, 2002-10-17 at 14:52, Manoj Japher wrote: hi, I would like to format my output. I would like to represent my integer outputs as 2,000 instead of 2000 which it prints by default. For e.g. I want 200 to be printed as 2,000,000 Do we have any functions which does that? Thanks in advance, Best Regards, Manoj Life,it is not a problem to be solved, but a process to be managed. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Life,it is not a problem to be solved, but a process to be managed. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] f
f -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: DBF question: column names?
Hi, You can open the DBF file in Excel and the first column is the name, so if you want to know the structure you can use DBU.exe that is included in clipper. Suzerain.Studios [EMAIL PROTECTED] escribió en el mensaje news:a05111a52b9c64fa4b608;[192.168.2.5]... Hi there. I'm not familiar with DBF files, or the PHP dbase functions. I've found (very) few code snippets on the Web about DBF files...a class on PHP classes and a couple of other brief mentions elsewhere. I have a question: I was given a DBF file that I don't know the structure of. Is there any way to read the column names and find out what they are, or do I need to have someone send me a description of the table structure before I can work with their file? I assumed I could just read the structure, and then print the column names out or smething, but I can't seem to find any examples of that. -- Marc Antony Vose http://www.suzerain.com/ Imagination is more important than knowledge. -- Albert Einstein -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Calendar
Hi! Im new to PHP programming and need some help, I want to put an event calendar on my site... Functions I would like: Customizeable, so i can make it fit my design Calendar view: A small month view on the side with clickabel days to view the event for that day. Event view: Date, time, event Admin site with login: Add events I would like this to run with a mySql database. Is there anyone her who happens to have a script like this?? Anyone wants to make it?? Or anyone got a link for one that maches my request?? Please help... Joran Sorbo :: Norway -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: f
sorry about the message, I accidently sent it -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MS Access
Hi Has anyone got a sample script that updates/adds and deletes records on an ms access database or can point me to a resource that will have one? Regards Steve Dodkins IMPORTANT NOTICE The information in this e-mail is confidential and should only be read by those persons to whom it is addressed and is not intended to be relied upon by any person without subsequent written confirmation of its contents. ebm-ZIEHL (UK) Ltd. cannot accept any responsibility for the accuracy or completeness of this message as it has been transmitted over a public network. Furthermore, the content of this e-mail is the personal view of the sender and does not represent the advice, views or opinion of our company. Accordingly, our company disclaim all responsibility and accept no liability (including in negligence) for the consequences of any person acting, or refraining from acting, on such information prior to the receipt by those persons of subsequent written confirmation. In particular (but not by way of limitation) our company disclaims all responsibility and accepts no liability for any e-mails which are defamatory, offensive, racist or in any other way are in breach of any third party's rights, including breach of confidence, privacy or other rights. If you have received this e-mail message in error, please notify me immediately by telephone. Please also destroy and delete the message from your computer. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message is strictly prohibited. If you have received this E-mail in error, or suspect that the message may have been intercepted or amended, please notify ebm-ZIEHL (UK) Ltd on +44(0)1245 468555. ebm-ZIEHL (UK) Ltd Chelmsford Business Park, Chelmsford, Essex CM2 5EZ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Manioulating a Flat File
Hi: I am new to this list. Maybe this has been covered here already several time, and if it has I apologize. I tried searching, but it yielded nothing. Here's what I'd like to know: Is there a PHP function for easily finding and removing a line from a flat file of data. And, if not, is there a way to remove a line (or lines) after finding them using fget()? Thanks very much for your help! dkmb - Do you Yahoo!? Faith Hill - Exclusive Performances, Videos, more faith.yahoo.com
[PHP-DB] Re: Calendar
Thank you all for your help :) I found a script that needs som rewriteng (got permission to:) ) Chers :) Joran [EMAIL PROTECTED] wrote in message news:20021017103821.13351.qmail;pb1.pair.com... Hi! Im new to PHP programming and need some help, I want to put an event calendar on my site... Functions I would like: Customizeable, so i can make it fit my design Calendar view: A small month view on the side with clickabel days to view the event for that day. Event view: Date, time, event Admin site with login: Add events I would like this to run with a mySql database. Is there anyone her who happens to have a script like this?? Anyone wants to make it?? Or anyone got a link for one that maches my request?? Please help... Joran Sorbo :: Norway -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] welp! having problems with flash display
Hi all, im trying to retrieve data from my db (postgresql) and display it (an ad). now when i don't try to enter it to a display code of flash (embed src=... and so on) it display the flash fine just in the biggest proportion it can get and it overwrite on the rest of the html. when i tried to take the data and insert it into the embed src (at the flash code with the right porporties) as a file (swf extension) it display the swf file but only as a white squre with the right measures as i gave it at the code (it also doesnt overwrite the rest of the html) but it wont display the clip itself! can anyone help me with this or just give me a link to related info? Thanks in advance, Ben-Nes Yonatan p.s first time that i use newsgroups for such things... so.. if i did something wrong just notify me :P
RE: [PHP-DB] Calendar
Check out http://www.hotscripts.com and click on PHP, then Calendars Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:gary.every;ingramentertainment.com http://accessingram.com -Original Message- From: Joran [mailto:joran.sorbo;teleweb.no] Sent: Thursday, October 17, 2002 5:39 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Calendar Hi! Im new to PHP programming and need some help, I want to put an event calendar on my site... Functions I would like: Customizeable, so i can make it fit my design Calendar view: A small month view on the side with clickabel days to view the event for that day. Event view: Date, time, event Admin site with login: Add events I would like this to run with a mySql database. Is there anyone her who happens to have a script like this?? Anyone wants to make it?? Or anyone got a link for one that maches my request?? Please help... Joran Sorbo :: Norway -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Number Conversion
hi, I would like to format my output. I would like to represent my integer outputs as 2,000 instead of 2000 which it prints by default. For e.g. I want 200 to be printed as 2,000,000 Do we have any functions which does that? Thanks in advance, Best Regards, Manoj Life,it is not a problem to be solved, but a process to be managed. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Manioulating a Flat File
Here's what I'd like to know: Is there a PHP function for easily finding and removing a line from a flat file of data. And, if not, is there a way to remove a line (or lines) after finding them using fget()? Easy way to do this is with file(). It'll read the entire file into an array, with each array element being a line of the file. Use array_search() to find the line you're looking for, then unset() that element. //line to look for $search = ...; $file = file(file.txt); $key = array_search($search,$file); if($key === FALSE) { echo line not found; } else { unset($file[$key]); } //write corrected file back to disk $fp = fopen(file.txt); fwrite($fp,implode(\n,$file); fclose($fp); Adapt to your needs... ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Variable won't be passed from HTTP address bar
Ok.. I'm not a newbie I thought.. I do have experience with PHP, but I never suffered from this error. I used on my own redhat 8.0 server the following test-script: if($action==test){ echo Test;} I tried it to run with: 127.0.0.1/index.php?action=test It doesn't print anything. (which means I even can't print hello world :P) Oh, other variable constructions like $bla = blah . echo $bla etc. do work.. With regards, Michel Bakkenes J2ee developer Infolook BV Zevenbergen, The Netherlands
Re: [PHP-DB] Variable won't be passed from HTTP address bar
Check your register_globals setting in your php.ini file. This used to default to 'yes', but now defaults to 'no'. On Fri, 2002-10-18 at 06:26, Michel Bakkenes - bakkenes.net wrote: Ok.. I'm not a newbie I thought.. I do have experience with PHP, but I never suffered from this error. I used on my own redhat 8.0 server the following test-script: if($action==test){ echo Test;} I tried it to run with: 127.0.0.1/index.php?action=test It doesn't print anything. (which means I even can't print hello world :P) Oh, other variable constructions like $bla = blah . echo $bla etc. do work.. With regards, Michel Bakkenes J2ee developer Infolook BV Zevenbergen, The Netherlands -- Linux: Because rebooting is for adding hardware. Fingerprint = CE24 057D 1E88 A253 3196 89DB 9FF0 9EF0 2F70 8BE8 BE8 signature.asc Description: This is a digitally signed message part
Re: [PHP-DB] Variable won't be passed from HTTP address bar
On Fri, 18 Oct 2002 13:26:20 +0200 Michel Bakkenes - bakkenes.net [EMAIL PROTECTED] wrote: Ok.. I'm not a newbie I thought.. I do have experience with PHP, but I never suffered from this error. I used on my own redhat 8.0 server the following test-script: if($action==test){ echo Test;} Looks like you do not have register_globals ON :-), as far as I suppose $action comes from get or post. hth pa -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Automattic Rollback on User Cancel with MySQL
I Am using the latest PHP version 4.2.3 with MySQL 3.23.51-max. I use InnoDB tables for transactions and everything works fine with Rollback and Commit. But when the user presses cancel in the browser or the script stops due to an error in the script all open transactions are committed instead of rolled back. Is there some way to change this behavior ? Look at the Connection Handling functions in the manual. http://www.php.net/manual/en/features.connection-handling.php You can detect when the user has aborted the script (pressed cancel) and react accordingly. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Variable won't be passed from HTTP address bar
Perhaps , $action is not equal to test. Try initializing the $action variable - instead of leaving it uninitialized. ?php $action = test; if($action==test) echo Test; } ? -Original Message- From: Michel Bakkenes - bakkenes.net [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Friday, October 18, 2002 6:26 AM Subject: [PHP-DB] Variable won't be passed from HTTP address bar Ok.. I'm not a newbie I thought.. I do have experience with PHP, but I never suffered from this error. I used on my own redhat 8.0 server the following test-script: if($action==test){ echo Test;} I tried it to run with: 127.0.0.1/index.php?action=test It doesn't print anything. (which means I even can't print hello world :P) Oh, other variable constructions like $bla = blah . echo $bla etc. do work.. With regards, Michel Bakkenes J2ee developer Infolook BV Zevenbergen, The Netherlands -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySql Statement inside a function?
Hi All I have created a function and insde that function it dose a standard select, fetch_arry, while loop. I get a error from mysql saying not a vaild resource but if I take the statemnet out of the function all works fine and dandy. Are there things I should be aware of when trying to include mysql statements inside a function? I have include my code here if it helps. function getnames(){ $gnlistsql = select name from $tbn2; $gnlistres = mysql_query($gnlistsql); while($nlist = mysql_fetch_array($gnlistres)){ $nlistop = option value=\$nlist[name]\$nlist[name]/option; $nlistsel = select name=\getname\$nlistop/select; echo $nlistsel; } } There error is reported back in the while line... Any help or advice is appreciated as always. P.S reason for the fuction is that I will call the select a name list a few times so I thought of making it a function then calling it when needed. Thank You Dave C -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySql Statement inside a function?
i'm certainly no expert, but here are my thoughts: the variable $tbn2 probabyl has no value inside of your function. so the query is really just select name from. i'd suggest you pass the $tbn2 value to the function. also, it is generally a bad idea to have a echo statements in function. rather you should return the results. hope that helps. -rob -Original Message- From: Dave Carrera [mailto:dave;davecarrera.com] Sent: Friday, October 18, 2002 10:52 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySql Statement inside a function? Hi All I have created a function and insde that function it dose a standard select, fetch_arry, while loop. I get a error from mysql saying not a vaild resource but if I take the statemnet out of the function all works fine and dandy. Are there things I should be aware of when trying to include mysql statements inside a function? I have include my code here if it helps. function getnames(){ $gnlistsql = select name from $tbn2; $gnlistres = mysql_query($gnlistsql); while($nlist = mysql_fetch_array($gnlistres)){ $nlistop = option value=\$nlist[name]\$nlist[name]/option; $nlistsel = select name=\getname\$nlistop/select; echo $nlistsel; } } There error is reported back in the while line... Any help or advice is appreciated as always. P.S reason for the fuction is that I will call the select a name list a few times so I thought of making it a function then calling it when needed. Thank You Dave C -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySql Statement inside a function?
Dave, I'd agree with Rob especially about returning the results. Plus it's always a good idea to add error checking to your SQL statement. Try replacing your existing line of code with this to make sure you query is actually returning valid results before trying to operate on them. $gnlistres = mysql_query($gnlistsql) or die(mysql_error()); (I think that syntax is right). I also don't see where you're actually setting up the db connection and selecting a database. Are you doing so within the scope of this script? Finally, within the while loop, I've always used statements like $var = $row[colName]. I noticed you don't have yours quoted. Don't know if that makes a difference. The error you're getting is before those lines anyway, so maybe not. Just my $.03. Inflation. Hope this helps. Rich -Original Message- From: Dave Carrera [mailto:dave;davecarrera.com] Sent: Friday, October 18, 2002 11:52 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySql Statement inside a function? Hi All I have created a function and insde that function it dose a standard select, fetch_arry, while loop. I get a error from mysql saying not a vaild resource but if I take the statemnet out of the function all works fine and dandy. Are there things I should be aware of when trying to include mysql statements inside a function? I have include my code here if it helps. function getnames(){ $gnlistsql = select name from $tbn2; $gnlistres = mysql_query($gnlistsql); while($nlist = mysql_fetch_array($gnlistres)){ $nlistop = option value=\$nlist[name]\$nlist[name]/option; $nlistsel = select name=\getname\$nlistop/select; echo $nlistsel; } } There error is reported back in the while line... Any help or advice is appreciated as always. P.S reason for the fuction is that I will call the select a name list a few times so I thought of making it a function then calling it when needed. Thank You Dave C -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Log Application Formatting Issue...
I am trying to tweak an application that I have developed. The application is our On-Call Log. This application consists of three pages; one page to input new entries, one page to edit existing entries, and finally a log view page. The log view page displays all entries for the past 5 days. The display of the entries is formatted properly, and presented chronologically with the oldest first with 10 items per page. This is exactly what I want. The one thing that I want to change is that the log defaults to displaying the first page containing the oldest items. I would like the log to display exactly as it does, but default to displaying the last page first. This way we see the most recent items first. I hope this makes sense, and following is what I think are the relevant sections of the code: { some code snipped } mysql_select_db($database, $Prod); $query_entry = SELECT * FROM oncall WHERE TO_DAYS(NOW()) - TO_DAYS(ptime) =5 ORDER BY 'ptime' ASC; $query_limit_entry = sprintf(%s LIMIT %d, %d, $query_entry, $startRow_entry, $maxRows_entry); $entry = mysql_query($query_limit_entry, $Prod) or die(mysql_error()); $row_entry = mysql_fetch_assoc($entry); if (isset($HTTP_GET_VARS['totalRows_entry'])) { $totalRows_entry = $HTTP_GET_VARS['totalRows_entry']; } else { $all_entry = mysql_query($query_entry); $totalRows_entry = mysql_num_rows($all_entry); } $totalPages_entry = ceil($totalRows_entry/$maxRows_entry)-1; { Not completely sure what following section does. } $queryString_entry = ; if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) { $params = explode(, $HTTP_SERVER_VARS['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, pageNum_entry) == false stristr($param, totalRows_entry) == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_entry = . implode(, $newParams); } } $queryString_entry = sprintf(totalRows_entry=%d%s, $totalRows_entry, $queryString_entry); ? { I know that this has to do with handling the log page numbering, but fuzzy on the details. } { some html formatting snipped } ?php do { if ($row_entry['P1']) { ? tr td height=23 bgcolor=#FAADBC div align=centera href=oncall_update.php?callid=?php echo $row_entry['callid']; ??php echo $row_entry['callid']; ?/a/div/td td valign=top bgcolor=#FAADBC?php echo $row_entry['sa']; ?/td td valign=top bgcolor=#FAADBC?php echo $row_entry['ptime']; ?/td td valign=top bgcolor=#FAADBCdiv align=center?php echo $row_entry['system']; ?/div/td td valign=top bgcolor=#FAADBC?php echo $row_entry['name']; ?/td td valign=top bgcolor=#FAADBC?php echo $row_entry['problem']; ?/td td valign=top bgcolor=#FAADBC?php echo $row_entry['resolution']; ?/td /tr ?php } else { ? tr td height=23 bgcolor=#CC div align=centera href=oncall_update.php?callid=?php echo $row_entry['callid']; ??php echo $row_entry['callid']; ?/a/div/td td valign=top bgcolor=#CC?php echo $row_entry['sa']; ?/td td valign=top bgcolor=#CC?php echo $row_entry['ptime']; ?/td td valign=top bgcolor=#CCdiv align=center?php echo $row_entry['system']; ?/div/td td valign=top bgcolor=#CC?php echo $row_entry['name']; ?/td td valign=top bgcolor=#CC?php echo $row_entry['problem']; ?/td td valign=top bgcolor=#CC?php echo $row_entry['resolution']; ?/td /tr ?php } ? { Snipped the rest } I am using DreamWeaver MX, so some of this code may be a little strange. This is also the reason why I am a bit confused by some of what is goign on in the page. Thanks in advance for the help. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Variable won't be passed from HTTP address bar
Try instead: if( $_POST['action'] ==test ){ echo Test;} HTH Ignatius - Original Message - From: Michel Bakkenes - bakkenes.net [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 18, 2002 1:26 PM Subject: [PHP-DB] Variable won't be passed from HTTP address bar Ok.. I'm not a newbie I thought.. I do have experience with PHP, but I never suffered from this error. I used on my own redhat 8.0 server the following test-script: if($action==test){ echo Test;} I tried it to run with: 127.0.0.1/index.php?action=test It doesn't print anything. (which means I even can't print hello world :P) Oh, other variable constructions like $bla = blah . echo $bla etc. do work.. With regards, Michel Bakkenes J2ee developer Infolook BV Zevenbergen, The Netherlands -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Log Application Formatting Issue...
On Saturday 19 October 2002 00:09, NIPP, SCOTT V (SBCSI) wrote: I am trying to tweak an application that I have developed. The application is our On-Call Log. This application consists of three pages; one page to input new entries, one page to edit existing entries, and finally a log view page. The log view page displays all entries for the past 5 days. The display of the entries is formatted properly, and presented chronologically with the oldest first with 10 items per page. This is exactly what I want. The one thing that I want to change is that the log defaults to displaying the first page containing the oldest items. I would like the log to display exactly as it does, but default to displaying the last page first. This way we see the most recent items first. I hope this makes sense, and following is what I think are the relevant sections of the code: One quick fix is to just display the items in reverse order so the newest items are always first ... { some code snipped } mysql_select_db($database, $Prod); $query_entry = SELECT * FROM oncall WHERE TO_DAYS(NOW()) - TO_DAYS(ptime) =5 ORDER BY 'ptime' ASC; ... change the ASC to DESC should do the trick. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Yow! Did something bad happen or am I in a drive-in movie?? */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Log Application Formatting Issue...
Yeah, this is the exact fix I am trying to avoid. Thanks for the feedback, but I prefer to keep the items chronological ascending order. I know there has to be a way to simply default the display to the last page of the dataset. -Original Message- From: Jason Wong [mailto:phplist;gremlins.com.hk] Sent: Friday, October 18, 2002 11:58 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Log Application Formatting Issue... On Saturday 19 October 2002 00:09, NIPP, SCOTT V (SBCSI) wrote: I am trying to tweak an application that I have developed. The application is our On-Call Log. This application consists of three pages; one page to input new entries, one page to edit existing entries, and finally a log view page. The log view page displays all entries for the past 5 days. The display of the entries is formatted properly, and presented chronologically with the oldest first with 10 items per page. This is exactly what I want. The one thing that I want to change is that the log defaults to displaying the first page containing the oldest items. I would like the log to display exactly as it does, but default to displaying the last page first. This way we see the most recent items first. I hope this makes sense, and following is what I think are the relevant sections of the code: One quick fix is to just display the items in reverse order so the newest items are always first ... { some code snipped } mysql_select_db($database, $Prod); $query_entry = SELECT * FROM oncall WHERE TO_DAYS(NOW()) - TO_DAYS(ptime) =5 ORDER BY 'ptime' ASC; ... change the ASC to DESC should do the trick. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Yow! Did something bad happen or am I in a drive-in movie?? */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Log Application Formatting Issue...
on 10/18/02 1:03 PM, NIPP, SCOTT V (SBCSI) at [EMAIL PROTECTED] appended the following bits to my mbox: Yeah, this is the exact fix I am trying to avoid. Thanks for the feedback, but I prefer to keep the items chronological ascending order. I know there has to be a way to simply default the display to the last page of the dataset. I can think of a few other ways, none perfect: 1) Perform the same query as now, then use mysql_data_seek to start at 10 rows from the end. Something like: mysql_data_seek($result, mysql_num_rows($result) - 10); The next 10 calls to mysql_fetch_* will give you the rows you want. (for $I=0; $I 10; $I++) The next page you do the same with 20, etc. 2) Similar thing, but first get the number of rows for the query, either the same one or a SELECT COUNT(*) query, then use MySQL limit to limit to the 10 rows from the end. 3) Change to DESC as suggested by someone else, but instead of directly outputting the result, store it into another array. Then reverse that array in php and display it. HTH. Sincerely, Paul Burney http://paulburney.com/ ?php while ($self != asleep) { $sheep_count++; } ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PostgreSQL and HTML output
Dear Robertson, Try something like this with a simple table, create it like this in mysql: CREATE TABLE HITS ( IDNR INTEGER AUTO_INCREMENT PRIMARY KEY, REFFER VARCHAR(255), HIT_DATE TIMESTAMP(8) ); And the as a .php file, try something like this: - html headtitleSimple outputpage for a MySQL-query/title/head body bgcolor=#FF text=#00 table width=100% ? // Let's start the database-connection mysql_connect('your_hostname','your_username','your_password') or die(Unable to connect to the SQL server...); mysql_select_db(your_database_name); // The query $SQL_QUESTION = select REFFER,HIT_DATE from HITS; $SQL_QUERY = mysql_query( $SQL_QUESTION ); // Let's go with the query and build the table while ($row=mysql_fetch_array($SQL_QUERY)) { echo 'tr'; echo 'td'; echo $row[REFFER]; echo '/td'; echo 'td'; echo $row[HIT_DATE]; echo '/td'; echo '/tr'; } ? /table /body /html -- If none of this makes any sense to you please start at the beginning, Try http://www.devshed.com for some excellent tutorials. Good Luck, Maarten Verheijen - Original Message - From: Edwin Robertson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 18, 2002 7:02 PM Subject: [PHP-DB] PostgreSQL and HTML output With psql you can get all your output in HTML format. Anyone know of a way to do this in PHP? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PostgreSQL and HTML output
With psql you can get all your output in HTML format. Anyone know of a way to do this in PHP? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PostgreSQL and HTML output
On Saturday 19 October 2002 01:02, Edwin Robertson wrote: With psql you can get all your output in HTML format. Anyone know of a way to do this in PHP? The usual way is to write some code to do it. If you don't want to write your own code search for some ready-made ones, ADOdb springs to mind. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* No matter where I go, the place is always called here. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: PostgreSQL and HTML output
Edwin Robertson wrote: (B With psql you can get all your output in HTML format. Anyone know of a way (B to do this in PHP? (B (BIt's psql feature and there is no automatic HTML format (Bin PHP's pgsql module. (B (BIf really would like, you can use passthru() and psql. (B (B?php (Bpassthru('/usr/local/pgsql/bin/psql -f select.sql -H -U yohgaki -d test'); (B? (B (Bwhere "select.sql" is query you need. (B (B-- (BYasuo Ohgaki (B (B (B-- (BPHP Database Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: PostgreSQL and HTML output
If you need to dump query result for debugging purpose, etc. (BTry something like, (B (B?php (B (B$db = pg_connect(); (B$result = pg_query($db, 'SELECT * FROM some_table'); (B (Becho "pre\n"; (Bvar_dump(pg_fetch_all($result)); (Becho "/pre\n"; (B (B? (B (BYou need PHP 4.3.0-dev or later for pg_fetch_all(). (B (B-- (BYasuo Ohgaki (B (BYasuo Ohgaki wrote: (B Edwin Robertson wrote: (B (BWith psql you can get all your output in HTML format. Anyone know of a way (Bto do this in PHP? (B (B (B It's psql feature and there is no automatic HTML format (B in PHP's pgsql module. (B (B If really would like, you can use passthru() and psql. (B (B ?php (B passthru('/usr/local/pgsql/bin/psql -f select.sql -H -U yohgaki -d test'); (B ? (B (B where "select.sql" is query you need. (B (B -- (B Yasuo Ohgaki (B (B (B (B-- (BPHP Database Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: [PHP] Re: Need help with HTTP-Authentication
Hi David,. Http authentication is probly not what you would want to use. Especially if you want to program in timeouts, you would be better off using session based login variables. Cookies are even better with an encrypted pasword that has a windows of time that you have to goto other pages to renew. Why HTTP auth? Is it mandatory? Well its not mandatory i gues. I just thought that using HTTP-Authentication was one of the more secure ways of a login system? But i have heared not thats not the case, so i might go for a login system with sessions instead, or cookies. What would u use and why? What excactly do u mean with timeouts? I know this hasnt been any help, sorry! Thats okay;-) Keeps the discusion alive;-) Best regards, Davy Obdam, mailto:info;davyobdam.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php