[PHP-DB] Sending HTML output from MySQL query to Excel
I searched the archives and read the postings about using header(Content-Type: application/vnd.ms-excel); to send tables dynamically constructed from a MySQL query to an excel spreadsheet, but when I tried it (using IE 6) all I got was a picture icon in the top left corner of the screen and no output anywhere. I know the query works, and I can create the tables just fine in HTML when I don't add any headers - so how do I get this to go into Excel? Thanks, -Lisi -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Final Date Question :-)
-Original Message- From: Chris Payne [mailto:[EMAIL PROTECTED]] Sent: 20 February 2003 01:52 OK here is a final date question. It's complex (Atleast to me :-( but i'm totally stumped. Here's what I need to do. Say September is Summer and October is winter, now getting the dates for each month is easy. Now, say in September each day is worth $50 but in October each day of the month is worth $70. Now finally, say you choose 2 days in September and 2 in October (And this is what stumps the living crap out of me - pardon les francais :-) the system has to know He chose 2 in september so that's $100 in total, but hold on, wait a minute, he chose 2 in october and these are worth $140 for 2 days) - so how can I get it to do that? I know how to get it to do the september, but finding that it ran into October and that Octobers 2 days are worth more than septembers just totally goes over my head :-( Well, you must have a start date and an end date -- and you must be able to work out in which season each one lies. So check whether the start date is in the same season as the end date -- if it is, all is hunky-dory; if not, then you have to work out how many days are in each season, calculate the subtotals for each group of days, and then add them back together to get a grand total. I would commend to you the construction mktime(12, 0, 0, 0, $month+1, $year) for finding the timestamp for midday of the last day of $month in $year -- works even when $month represents December! (Note: you need to watch out for daylight savings timeshifts if appropriate; you may prefer to do all your day-offset calculations using an appropriate time of day with gmmktime() so as to eliminate DST shift vagaries entirely!) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] TimeStamp format to date
Good afternoon, Houston i have a problem. :-) Just to play a while. Is like this i have a field in MySql TIME_STAMP int(11) and he has a time stamp value (ex: 1045738710) and i want to make show it like a date format in the web. Can anyone help me on this...? Cumprimentos Bruno Pereira [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] TimeStamp format to date
Is like this i have a field in MySql TIME_STAMP int(11) and he has a time stamp value (ex: 1045738710) and i want to make show it like a date format in the web. Can anyone help me on this...? Just SELECT it out and run it through the PHP date() function to format it. www.php.net/date Cumprimentos What'd you call me? ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] TimeStamp format to date
Cumprimentos What'd you call me? Sometimes it's the simple things that make you laugh the hardest. Thanks, John. -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 10:37 AM To: Bruno Pereira; [EMAIL PROTECTED] Subject: Re: [PHP-DB] TimeStamp format to date Is like this i have a field in MySql TIME_STAMP int(11) and he has a time stamp value (ex: 1045738710) and i want to make show it like a date format in the web. Can anyone help me on this...? Just SELECT it out and run it through the PHP date() function to format it. www.php.net/date Cumprimentos What'd you call me? ---John Holmes... -- 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] Unable to load dynamic library - Access is denied.
Hi, I am trying to get php version 4.3.0 to work with sybase. I am using Apache 2.0 on Win NT 4.0, service pack 6. I have been able to get PHP to work with the server, but not with Sybase. When I bring the server up, I get this message: PHP Warning: Unknown(): Unable to load dynamic library 'c:\php\extensions\php_sybase_ct.dll' - Access is denied. I have copied all dll's to the win nt directory, and copied the php_sybase_ct.dll to the system directory, as well. My php.ini has: ; Directory in which the loadable extensions (modules) reside. extension_dir = c:\php\extensions\ extension=php_sybase_ct.dll My httpd.conf file has: LoadModule php4_module c:/php/sapi/php4apache2.dll AddType application/x-httpd-php .php I have checked the archives at php.net and couldn't find anything similar to this problem. Any help would be appreciated. Thanks, Leonard Rutkowski -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Install Question
Has anyone used this option for compiling PHP with custom ODBC drivers. I am trying to use a Teradata ODBC driver and have not had any luck using iODBC. --with-custom-odbc[=DIR] Include a user defined ODBC support. The DIR is ODBC install base directory, which defaults to /usr/local. Make sure to define CUSTOM_ODBC_LIBS and have some odbc.h in your include dirs. E.g., you should define following for Sybase SQL Anywhere 5.5.00 on QNX, prior to run configure script: CPPFLAGS=-DODBC_QNX -DSQLANY_BUG LDFLAGS=-lunix CUSTOM_ODBC_LIBS=-ldblib -lodbc. Any help would be greatly appreciated. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Receiving ARRAY from Forms
I tried the following code but all I get back is Array. I'm trying to pass a huge array. ? if( isset( $submit ) ) { echo array list:br; print_r( $eList ); $submit = ; } else { $mList = array(); $mList[0] = 1. hello; $mList[1] = 2. there; $mList[2] = 3. How are you; $fShow = EOD pPress Submit Button to test/p form method=POST action=$PHP_SELF name=Test Array pinput type=submit value=Submit name=submit input type=reset value=Reset name=B2/p input type=hidden name=eList[] value=$mList /form EOD; echo $fShow; } ? - This mail sent through ISOT. To find out more about ISOT, visit http://isot.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: question in ADODB
yes, but can you tell me how? I have read the manual, but they didn't tell how to do so! -- Sincerely your; pei_world ( .::IT::. ) Philippe Saladin [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I found the following code on the internet. I'd like to know that what I need to do, if I want to use the actually Access file with out the DSN, how to use the Microsoft Jet? thx -- code include(adodb.inc.php); $db = NewADOConnection('mysql'); Look at the adodb manual : http://php.weblogs.com/adodb_manual $db = NewADOConnection('access'); (Microsoft Access/Jet. You need to create an ODBC DSN) or $db = NewADOConnection('ado_access'); (Microsoft Access/Jet using ADO. Allows DSN-less connections. For best performance, use an OLEDB provider.) Regards, Philippe -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Receiving ARRAY from Forms
You could use sessions to pass the array to the next page easily. $_SESSION[arraylist] = $mList; Then just grab it back from the other form. If you haven't used sessions before you can get a quick overview here. http://www.theoutersphere.com/php/sessions.php Kelly -Original Message- From: Squirrel User [mailto:[EMAIL PROTECTED]] Sent: February 20, 2003 9:41 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Receiving ARRAY from Forms I tried the following code but all I get back is Array. I'm trying to pass a huge array. ? if( isset( $submit ) ) { echo array list:br; print_r( $eList ); $submit = ; } else { $mList = array(); $mList[0] = 1. hello; $mList[1] = 2. there; $mList[2] = 3. How are you; $fShow = EOD pPress Submit Button to test/p form method=POST action=$PHP_SELF name=Test Array pinput type=submit value=Submit name=submit input type=reset value=Reset name=B2/p input type=hidden name=eList[] value=$mList /form EOD; echo $fShow; } ? - This mail sent through ISOT. To find out more about ISOT, visit http://isot.com -- 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] Receiving ARRAY from Forms
I tried the following code but all I get back is Array. I'm trying to pass a huge array. You need to serialize the array... ? if( isset( $submit ) ) { echo array list:br; print_r( $eList ); $submit = ; } else { $mList = array(); $mList[0] = 1. hello; $mList[1] = 2. there; $mList[2] = 3. How are you; $mList = serialize($mList); $fShow = EOD pPress Submit Button to test/p form method=POST action=$PHP_SELF name=Test Array pinput type=submit value=Submit name=submit input type=reset value=Reset name=B2/p input type=hidden name=eList[] value=$mList /form EOD; echo $fShow; } ? and unserialize() it on the receiving page to get your array back. If magic_quotes is on, be sure to stripslashes() it before unserialize()ing it. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] TimeStamp format to date
--- 1LT John W. Holmes [EMAIL PROTECTED] wrote: Cumprimentos What'd you call me? I think he's offering you a free minty freshmaker. = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] TimeStamp format to date
Dude, you just topped John! That was laugh-out-loud hilarious. Sorry this has gotten off-topic, but c'mon. A freshmaker? Classic, just classic. Rich -Original Message- From: Mark [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 12:09 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] TimeStamp format to date --- 1LT John W. Holmes [EMAIL PROTECTED] wrote: Cumprimentos What'd you call me? I think he's offering you a free minty freshmaker. = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ -- 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] TimeStamp format to date
I'm portuguese, so i say bye in portuguese. If i want to call something you can be jure of one thing it wouldnt be cumprimentos. But i wouldnt do that, cause you help me :-) Cumprimentos(Till next time), is the same. Bruno Pereira [EMAIL PROTECTED] -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: quinta-feira, 20 de Fevereiro de 2003 15:37 To: Bruno Pereira; [EMAIL PROTECTED] Subject: Re: [PHP-DB] TimeStamp format to date Is like this i have a field in MySql TIME_STAMP int(11) and he has a time stamp value (ex: 1045738710) and i want to make show it like a date format in the web. Can anyone help me on this...? Just SELECT it out and run it through the PHP date() function to format it. www.php.net/date Cumprimentos What'd you call me? ---John Holmes... -- 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] TimeStamp format to date
It's very good to see that a simple word cumprimentos can make a great discussion. :-) Cumprimentos Bruno Pereira [EMAIL PROTECTED] -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] Sent: quinta-feira, 20 de Fevereiro de 2003 17:09 To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] TimeStamp format to date Dude, you just topped John! That was laugh-out-loud hilarious. Sorry this has gotten off-topic, but c'mon. A freshmaker? Classic, just classic. Rich -Original Message- From: Mark [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 12:09 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] TimeStamp format to date --- 1LT John W. Holmes [EMAIL PROTECTED] wrote: Cumprimentos What'd you call me? I think he's offering you a free minty freshmaker. = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ -- 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 Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Sybase timouts
SQL error: [INTERSOLV][ODBC SQL Server driver][SQL Server]ct_connect(): user api layer: internal Client Library error: Read from the server has timed out., SQL state S1T00 in SQLConnect in Anyone had this problem? I cannot find anywhere that will allow me to change the timeout. Ryan Ryan Jameson Software Development Services Manager International Bible Society W (719) 867-2692 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Storing images in MySQL table
The only disadvantage i've had of storing images in DB instead of Filesystem, is that when you use a PHP script to output the image to a client browser, MSIE doesn't always accept a suggested filename so it might try and save it as your-script.php?img=2. Other then that, keeping images in DB is a lot easier since you don't have to keep your DB in sync with Filesystems ie. Deleted records in DB, but images still exist. A way I've gotten around this, is that when I dump images into a directory for use by articles in my db, the filename is always name $articleid.filename (since articles and pics are uploaded to the server via php, this is easy to enforce). Thus, when I do kill of articles and what not, I simply remove $articleid.* from my images directory as well. I would strongly argue against stuffing images into a database tho. That's what filesystems are for, and they are way better at it. The overhead alone is reason enough to make you decide against it. -- At no time is freedom of speech more precious than when a man hits his thumb with a hammer. -- Marshall Lumsden Sumbry][ [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Sybase timouts
Figured it out. it requires a default logon id on the connection tab on the odbc connection. Who knows why... Ryan -Original Message- From: Ryan Jameson (USA) Sent: Thursday, February 20, 2003 12:50 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Sybase timouts SQL error: [INTERSOLV][ODBC SQL Server driver][SQL Server]ct_connect(): user api layer: internal Client Library error: Read from the server has timed out., SQL state S1T00 in SQLConnect in Anyone had this problem? I cannot find anywhere that will allow me to change the timeout. Ryan Ryan Jameson Software Development Services Manager International Bible Society W (719) 867-2692 -- 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] displaying hyperlinks in MySQL query results
I have some code that pulls data from a MySQL db and displays it in a 4-column HTML table. The headings are: Port # Transport Application Vendor URL The first 3 columns return perfectly. The Vendor URL data, on the other hand, is returned as text, rather than hyperlinks. I've tried tweaking the code several different ways with no success. The following code is what I started with. It returns everything I need. The HTML table is formatted correctly. I thought I could use a 'hypertext' datatype in MySQL, but from what I see there isn't any such datatype. And I'm so new to PHP I don't know how to isolate the Vendor URL field and convert the results to links. Any help would be appreciated. print tabletrthPort #/th; print thTransport/thth align=centerApplication/thth align=centerVendor URL/th; while ($row = mysql_fetch_row($resultID)) { print tr; foreach ($row as $field) { print td align=center$field/td; } print /tr; } print /table; Thanks --rick -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] LIMIT problem MSSQL
Also, since Sybase ASE uses a lot of the same T-SQL constructs, you can attempt some methods located here: http://www.isug.com/Sybase_FAQ/ASE/section6.2.html#6.2.12 -- Matt Noam Giladi [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... a solution offered i received from raydan Untested: Untested: declare @num int set @num = 20 EXEC ('select top 10 from myTable where ID not in (select top ' + @num + ' from myTable order by ID) order by ID') But beware the dangers of dynamic SQL. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: displaying hyperlinks in MySQL query results
[EMAIL PROTECTED] (Rick Tucker) writes: [ snip ] The first 3 columns return perfectly. The Vendor URL data, on the other hand, is returned as text, rather than hyperlinks. I've tried tweaking the code several different ways with no success. The following code is what I started with. It returns everything I need. The HTML table is formatted correctly. I thought I could use a 'hypertext' datatype in MySQL, but from what I see there isn't any such datatype. And I'm so new to PHP I don't know how to isolate the Vendor URL field and convert the results to links. Any help would be appreciated. [ snip ] A hyperlink (such as you speak of) is an HTML construct. You can save one as text in a database, but the contents of the database are still text. It can be interpreted as hyperlinks by a web browser, but then it must contains a-tags (or similar). This is as such not really neither a php nor a mysql issue. When you print the url field, you have to print the html tag you need as well, like you have done with the other tags you use (table, td and so on). eg. printf(a href=\%s\%s/a, $url, $url); http://www.blooberry.com/indexdot/html is a nice html resource. Also, mysql_fetch_array($result) is easier to use, as it gives you an associative array, you don't need the indexes and it doesn't give much overhead (or at least, it's not supposed to). I wouldn't use a foreach() construct in your case, either, it's easier (and should be more efficient) to use something like printf(trtd%s/tdtd%s/td/tr\n, $data[0], $data[1]); and so on. -- --Fredrik ... and furthermore ... I don't like your trousers. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] php/mysql query
Hi there! I am querying our database for 11,000 different zip codes and it seems to be overloading MySQL. However, common sense says it shouldn't. My question is: When needing to query 11,000 things, is it best to make 1 SQL statement that has 11,000 ors, or run through individual querys 11,000 times? Any help would be wonderful! I am making PHP do the counting rather than MySQL. Thanks! Julie -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] php/mysql query
Well if the zip codes have something in common just do a pattern match for them or are you just picking random zip codes? This way you only need one one sql statement to bring everything back. Kelly -Original Message- From: Julie Keywell [mailto:[EMAIL PROTECTED]] Sent: February 20, 2003 10:01 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] php/mysql query Hi there! I am querying our database for 11,000 different zip codes and it seems to be overloading MySQL. However, common sense says it shouldn't. My question is: When needing to query 11,000 things, is it best to make 1 SQL statement that has 11,000 ors, or run through individual querys 11,000 times? Any help would be wonderful! I am making PHP do the counting rather than MySQL. Thanks! Julie -- -- 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] NotesSQL via ODBC in PHP
Has anybody tried to read/write a Lotus Notes Database via ODBC (NotesSQL)? I don't even get a valid connection with odbc_connect. With other tools (QTODBC) NotesSQL/ODBC is no problem at all. Anything wrong with the php ODBC driver in php 4.2.3 under Win2k? Are ther more reliable ODBC drivers? Thanks Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Looking for a Junior PHP/mySQL programmer - Sydney.AU
Excuse the cross-post... We're looking for a Junior PHP/mySQL programmer in Seven Hills in Sydney.AU The position will be on a fulltime basis. We are a Broadband ISP dealing with Request Broadband and other providers. We are not looking for a super-qualified programmer as we are willing to train. If you think you have talent AND passion for PHP and mySQL and you want to use your skills in a fast paced environment then we are the training ground. Skills required: PHP4 mySQL HTML, CSS some Javascript Basics of Linux (RedHat environment) Understanding of IP networking and protocols Troubleshooting/Debugging Skills Skills desirable (but willing to learn) DHTML Perl Understanding of XML Interface design skills - Graphic design Understanding of Internet security issues. Flash MX Dreamweaver MX The ideal successful applicant would be between 17-22 and wanting to get into the ISP industry. A person who plays well with others (team work) will work out the best in our fast paced but fun environment. Some demonstration of past work examples would be required... For those interested... please email: [EMAIL PROTECTED] (not the company you will be working for) ___ Skeeve Stevens, RHCE Email: [EMAIL PROTECTED] Website: www.skeeve.org - Telephone: (0414) 753 383 Address: P.O Box 1035, Epping, NSW, 1710, Australia eIntellego - [EMAIL PROTECTED] - www.eintellego.net ___ Si vis pacem, para bellum -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php