RE: [PHP-DB] mysql_fetch_assoc() bug with mysql 4.1 and fields escaping?

2004-12-02 Thread Gryffyn, Trevor
Funny, questions about MySQL 4.1.x seem to be popping up a lot recently. With good reason. There are some changes that make old mysql_*() functions not work anymore. I don't know all the ins and outs yet, but I ran into it last weekend and everything I saw seemed to recommend switching to th

RE: [PHP-DB] 5 hours later - sql error.

2004-12-02 Thread Gryffyn, Trevor
Looks like your $expLevl value is empty. It's probably set, but has no value in it. Check that. -TG > -Original Message- > From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 02, 2004 1:46 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] 5 hours later - sql error

RE: [PHP-DB] getting data back when inserting

2004-12-01 Thread Gryffyn, Trevor
I know this is only semi-helpful, but maybe it'll give you a kick in the right direction. In Microsoft SQL-Server you'd use @@IDENTITY to get the ID of the last row you inserted. There's bound to be something similar in other DB systems. "identity" is what SQL Server calls auto-number type field

RE: [PHP-DB] Question on the use of where statements

2004-12-01 Thread Gryffyn, Trevor
I think you may hit the limit on the number of characters in the SELECT statement before you hit the max number of WHERE items. It's a good question though.Try doing a worst case scenario (pick all the options, enter data that's the max character length for each item, etc). Either through you

RE: [PHP-DB] Use of 'as' name in where sub-clause

2004-12-01 Thread Gryffyn, Trevor
Yeah, I've asked this question myself a million times. It'd be very useful and maybe some DB system knows how to do this, but for the most part you just have to deal with this reality. I believe that it's a matter of timing, really. You can't use the alias in the WHERE clause because it hasn't b

[PHP-DB] Basic JOIN tutorial - RE: [PHP-DB] Job interview test - I give up...

2004-12-01 Thread Gryffyn, Trevor
Looks like you got a lot of good responses. I downloaded the zip file but then got slammed with some priority stuff and havn't had a chance to take a look at this. So in the interest of not forgetting and of closing this reply window :) just a quicky response. I had a lot of trouble initially w

RE: [PHP-DB] [PHP-DEV] KEYBOARD

2004-12-01 Thread Gryffyn, Trevor
If the touch screen emulates a mouse, then you could do something in HTML + Javascript. It wouldn't have anything to do with PHP, just a mouse driven entry page in HTML. You could put Internet Explorer (or most other browsers) in "kiosk mode" (aka "full screen mode") to hide the fact that it's in

RE: [PHP-DB] Multi-User Update Problem

2004-11-30 Thread Gryffyn, Trevor
You could always lock a record and only allow that user to see the locked files (maybe showing an icon indicating that it SHOULD already be checked out in another browser window and ask if the user still wants to open the file (in the case of a computer crash or they closed their browser without pr

RE: [PHP-DB] Excel - merging cells with PHP

2004-11-29 Thread Gryffyn, Trevor
You can also do a "Click here to download", send it headers identifying the the page being loaded as something like "application/Excel" or whatever the mime type is and pass it HTML. Excel will interpret it and load the data into cells. That gets around the whole COM thing. If you do that, then

RE: [PHP-DB] Multi-User Update Problem

2004-11-29 Thread Gryffyn, Trevor
Yeah, all good thoughts. Someone else had a similar question that I answered recently (I think it was in private email) and in addition to the thoughts below, you might also look into recording WHEN the record was opened (and locked) so you can expire the lockout. I'd use this in conjunction with

RE: [PHP-DB] Is there any replication service for MySQL?

2004-11-29 Thread Gryffyn, Trevor
http://dev.mysql.com/doc/mysql/en/Replication.html Check this page, it might be helpful. -TG > -Original Message- > From: Sadeq Naqashzade [mailto:[EMAIL PROTECTED] > Sent: Saturday, November 27, 2004 11:51 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Is there any replication service

RE: [PHP-DB] fatal error

2004-11-29 Thread Gryffyn, Trevor
What version of PHP are you using? Did you develop it on one system then move it to 'production' and now it doesn't work? PHP 5 has SQLite functions built into it, but PHP 4 doesn't (I think I got that right). You may need to make sure your extensions are loading properly and such. Is it just

RE: [PHP-DB] how to implement "pages" of results

2004-11-24 Thread Gryffyn, Trevor
Oh yeah.. LIMIT 30,2 would show 30 records starting with the second record. I knew I was forgetting something. Sorry for the misinformation. Trying to finish some stuff before leaving for the weekend, but wanted to at least give you a nudge before disappearing. Good luck! -TG > -Origin

RE: [PHP-DB] how to implement "pages" of results

2004-11-24 Thread Gryffyn, Trevor
Off the top of my head, doesn't LIMIT accept two paramters? Can't you do: LIMIT 30,2 That'd give you page 2 of a 30+ record result set, right? Using that, you can pass a page # when you click "next page" so previous page ends up being current page - 1 (and "if that is less than 1, then it equa

RE: [PHP-DB] Client username

2004-11-22 Thread Gryffyn, Trevor
First of all, some people may give you a hard time because this isn't really a database related question. You're better off asking questions like this on PHP General or even PHP Windows if it's windows specific. Also.. You need to specify whether you're talking about a Windows login to a domain,

RE: [PHP-DB] Optimize Query Output

2004-11-22 Thread Gryffyn, Trevor
To say that your query is "never going to look like that" isn't entirely true. I'm sure with enough CASE statements and the use of some variables and such you could get your SQL output to look like that. SQL is pretty powerful like that. BUT.. Everyone who said "Use PHP to filter/display the da

RE: [PHP-DB] Currency and number types...

2004-11-19 Thread Gryffyn, Trevor
Either way. :) > -Original Message- > From: Joseph Crawford [mailto:[EMAIL PROTECTED] > Sent: Friday, November 19, 2004 12:48 PM > To: Gryffyn, Trevor; [PHP-DB] Mailing List > Subject: Re: [PHP-DB] Currency and number types... > > > how about good old number_fo

RE: [PHP-DB] Currency and number types...

2004-11-19 Thread Gryffyn, Trevor
You might try this: http://us2.php.net/manual/en/function.money-format.php Money_format() In your database query, you can probably format the number how you want there too... Before you even get to PHP and round()ing it inside PHP. But do your math and using the money_format() function to display

php-db@lists.php.net

2004-11-19 Thread Gryffyn, Trevor
How are you storing the file in your PHP code? If it'll fit in a variable, it should be able to be stored in $_SESSION. This might mean using serialize() and unserialize(). Although someone may have a better way of doing this. It seems to me that storing an entire file in a variable is going to

RE: [PHP-DB] password encryption

2004-11-18 Thread Gryffyn, Trevor
-Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 18, 2004 12:15 PM > To: [EMAIL PROTECTED] > Subject: RE: [PHP-DB] password encryption > > > Quoting "Gryffyn, Trevor" <[EMAIL PROTECTED]>: > > > If yo

RE: [PHP-DB] password encryption

2004-11-18 Thread Gryffyn, Trevor
You can use PHP to handle the auth headers and all: http://www.php.net/manual/en/features.http-auth.php That might give you more flexibility than trying to dynamically set it on the .htpassword and such. There are a couple of ways to encrypt something. You can do it in a way that can be decry

RE: [PHP-DB] Numeric question

2004-11-16 Thread Gryffyn, Trevor
$number = 0.5907; Round($number,2); YAY! :) -TG > -Original Message- > From: Chris Payne [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 16, 2004 3:38 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Numeric question > > > Hi there everyone, > > > > Just a quick ques

RE: [PHP-DB] PHP vs ASP

2004-11-15 Thread Gryffyn, Trevor
These are some good points. My gut reaction is similar to Robby's, but here are the points he made: > PHP = free > ASP = not > > PHP = most widely used scripting language online > > PHP5 is out > > PHP = tons of open source libraries..free to download ASP comes free with PWS and IIS. So if y

RE: [PHP-DB] query of two tables returns too many rows, many more than the two tables contain

2004-11-11 Thread Gryffyn, Trevor
This is a common join issue. If you don't specify ANYTHING to connect between the two tables, it'll do one row from the first table, then ALL the rows from the second. Row #2 from the first, then ALL the rows from the second. If you had 600 rows in each table, you'd end up with 360,000 rows as a

[PHP-DB] Copyright law, how to protect your investment, how to protect your work... Was - RE: [PHP-DB] Please point me in the right direction.......

2004-11-10 Thread Gryffyn, Trevor
I'm surprised I havn't seen this question come up before (might have just missed it) but it's an excellent question so forgive the crossposting as it's extremely relevant to coders and those purchasing services of coders. Anyone who's gotten married and hired a wedding photographer is probably fam

RE: [PHP-DB] folder creation in php

2004-10-12 Thread Gryffyn, Trevor
windows box by default). If, for example, you generated html like this though: Your Download Then your "datasendscript.php" would have to generate the proper headers. -TG > -Original Message- > From: Dylan Barber [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 12,

RE: [PHP-DB] folder creation in php

2004-10-12 Thread Gryffyn, Trevor
The browser will automatically do this when you click on a link to a file that the web browser knows as a file that you download versus HTML or text being sent to the browser where it's just displayed instead of triggering the download prompt. Maybe that doesn't make much sense.. My head's a bit f

RE: [PHP-DB] -14 Days Ago

2004-10-08 Thread Gryffyn, Trevor
That's probably the best way to go, but if you wanted another way: $mySqlDate = "20041008"; $month = substr($mySqlDate,4,2); $day = substr($mySqlDate,6,2); $year = substr($mySqlDate,0,4); $mySqlDateSerial = mktime(0,0,0,$month,$day,$year); $twoWeeksAgoSerial = mktime(0,0,0,date("m"),date("d")-14,

RE: [PHP-DB] microsoft access

2004-10-01 Thread Gryffyn, Trevor
Original Message- > From: Robert Twitty [mailto:[EMAIL PROTECTED] > Sent: Friday, October 01, 2004 2:27 PM > To: Gryffyn, Trevor > Cc: [EMAIL PROTECTED]; Matt M.; Matthew Perry > Subject: RE: [PHP-DB] microsoft access > > > ADODB is a PHP abstraction layer class. In oth

RE: [PHP-DB] microsoft access

2004-10-01 Thread Gryffyn, Trevor
I'm guessing that COM is going to be overkill for this. I thought some systems like ADOdb let you get to Access tables directly without COM. I'm imaginging that COM might not always be a viable way to go anyway, if you have an Access .MDB file on a server where your PHP stuff is hosted, they prob

RE: [PHP-DB] Invisible Submit

2004-10-01 Thread Gryffyn, Trevor
You could do something trick with an IFRAME or something that calls another script passing the data via the URL/$_GET instead of submitting a hidden form. Or just record the data in the session variables and process it that way. If you're using PHP, there's lots of things you can do to capture da

RE: [PHP-DB] Names with apostrophe's

2004-09-29 Thread Gryffyn, Trevor
Try: Echo "$row[book]\"; I'm dubious on the $row[book] bit took, maybe you meant $row["book"] or $row[$book]. Anyway, you didn't have a closing quote on the HREF, you don't need the ( and ) on the echo, you used the ' instead of " for the HREF (which is probably allowed but I don't like it mysel

RE: [PHP-DB] Linux/PHP/Access Database - oh boy :(

2004-05-12 Thread Gryffyn, Trevor
> -Original Message- > From: Alex Gemmell [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 12, 2004 12:19 PM > To: Gryffyn, Trevor; 'PHP List' > Subject: RE: [PHP-DB] Linux/PHP/Access Database - oh boy :( > > > Apologies if my situation isn't clear. My b

RE: [PHP-DB] Linux/PHP/Access Database - oh boy :(

2004-05-12 Thread Gryffyn, Trevor
L PROTECTED] > Sent: Wednesday, May 12, 2004 12:09 PM > To: Gryffyn, Trevor; 'PHP List' > Cc: 'Robert Twitty' > Subject: RE: [PHP-DB] Linux/PHP/Access Database - oh boy :( > > > Thanks again Trevor and Bob! > > The reason I was mentioning ASP is bec

RE: [PHP-DB] Linux/PHP/Access Database - oh boy :(

2004-05-12 Thread Gryffyn, Trevor
es is pull the data from the MDB and use PHP for all the rest of your processing. -TG > -Original Message- > From: Robert Twitty [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 12, 2004 11:46 AM > To: Alex Gemmell > Cc: 'PHP List'; Gryffyn, Trevor > Subject:

RE: [PHP-DB] Linux/PHP/Access Database - oh boy :(

2004-05-12 Thread Gryffyn, Trevor
mailto:[EMAIL PROTECTED] Sent: Wednesday, May 12, 2004 10:27 AM To: 'PHP List' Cc: Gryffyn, Trevor Subject: RE: [PHP-DB] Linux/PHP/Access Database - oh boy :( Thank you Trevor! Funny you should mention ADOdb. I

RE: [PHP-DB] Linux/PHP/Access Database - oh boy :(

2004-05-12 Thread Gryffyn, Trevor
First, I don't think you are likely to use COM calls on a linux box since COM and DCOM are MS things aren't they? Even if not, it might require some configuration on the server end which you can't do. I use the ADOdb database library for PHP in all the things I do: http://php.weblogs.com/adodb