[PHP-DB] Re: help w/Multiple Joins

2002-11-21 Thread Bastian Vogt
hi, you have to create aliases for every column you want to fetch results from. you have to change your query like this: SELECT i1.img_path AS i1_path, i2.img_path AS i2_path, i3. you can leave out the AS if you want to.. hth, bastian $result = mysql_query(SELECT * FROM photo_album as p

[PHP-DB] right join

2002-11-21 Thread Steve Dodkins
Hi How do I get the following select to exclude records where labor_qty from labor does not have a record? $result = mysql_query(SELECT labor_ord_no,works_orders_ord_no,works_orders_part_no,works_orders_qty,labor _qty FROM labor RIGHT JOIN works_orders ON labor_ord_no = works_orders_ord_no

[PHP-DB] Re: right join

2002-11-21 Thread Bastian Vogt
hi, did you try ...FROM labor RIGHT JOIN works_orders ON labor_ord_no = works_orders_ord_no WHERE labor_qty='' ORDER BY labor_qty,$link); ? i think that should do it regards, bastian How do I get the following select to exclude records where labor_qty from labor does not have a record?

RE: [PHP-DB] Select Last row

2002-11-21 Thread Rich Gray
Does 'select * from table order by id desc limit 1' do what you want? HTH Rich -Original Message- From: Afif [mailto:[EMAIL PROTECTED]] Sent: 21 November 2002 01:49 To: PHP DB Subject: [PHP-DB] Select Last row dear All, I have data and I want to get the last row of my table. how to

[PHP-DB] Help with Date

2002-11-21 Thread Rodrigo CorrĂȘa
Is there a way to convert a date 20/11/2002 to a Float number in PHP, since the date starts in 30/12/1899, just like the delphi treats the dates Thanks in Advance... Equipe Pratic Sistemas

Re: [PHP-DB] Help with Date

2002-11-21 Thread DL Neil
Rodrigo, Is there a way to convert a date 20/11/2002 to a Float number in PHP, since the date starts in 30/12/1899, just like the delphi treats the dates =Check out UNIX timestamps (but watch the valid date range), =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe,

RE: [PHP-DB] how to clear the array

2002-11-21 Thread Hutchins, Richard
If you have a variable: $myArray = array(); Can't you clear it by saying unset($myArray)? According to the documentation, it looks like you should be able to. -Original Message- From: Dave Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 1:12 AM To: karthikeyan;

RE: [PHP-DB] how to clear the array

2002-11-21 Thread Hutchins, Richard
Sorry. Didn't read original post. Try this: $myArray = array('1','2','3'); $numElements = count($myArray); for($i=0;$i=$numElements;$i++){ unset($myArray[$i]); } If the code above doesn't work, check the link below. This all SOUNDS easy enough to accomplish (theoretically), but I've

[PHP-DB] IMAP Body to MySQL

2002-11-21 Thread Brian Mitchell
I'm trying to write the body of a plain text email to a MySQL database. However, nothing gets inserted into the body field of the table when the following lines are executed. I've echoed the $body string back to the screen and nothing seems amiss. All the other fields are inserted correctly.

[PHP-DB] Get Last ID Inserted

2002-11-21 Thread Adam Voigt
Using Microsoft SQL does anyone know how to get the id of the row that you just inserted without clumsily trying to select the id back based on the same criteria of your insert (which might be overlapping)? -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key:

[PHP-DB] inserting html into mysql tables

2002-11-21 Thread mike karthauser
hi, is there anything special i need to know in regards to creating a table to hold html data? I am building a CMS for a site using php and mysql. The various tables hold course information that the client wants to edit. I imagine it will be a case of dropping the cleaned html source from

Re: [PHP-DB] inserting html into mysql tables

2002-11-21 Thread Adam Voigt
Well for one, VARCHAR is limited to 255 characters, so I would use a TEXT type datafield if you want to store more then 255. On Thu, 2002-11-21 at 11:01, mike karthauser wrote: hi, is there anything special i need to know in regards to creating a table to hold html data? I am building a CMS

[PHP-DB] Re: Get Last ID Inserted

2002-11-21 Thread David Elliott
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Adam On 21 November 2002 at 10:47:15 -0500 (which was 15:47 where I live) Adam Voigt wrote Using Microsoft SQL does anyone know how to get the id of the row that you just inserted without clumsily trying to select the id back based on the

Re: [PHP-DB] Re: Get Last ID Inserted

2002-11-21 Thread Adam Voigt
But if there are heavy operations on the site, will this not also pick up a different last inserted id, if in the split milisecond between the insert and the next mssql_query which has the @@identity say, another user does an insert? On Thu, 2002-11-21 at 11:03, David Elliott wrote: -BEGIN

RE: [PHP-DB] Re: Get Last ID Inserted

2002-11-21 Thread Ryan Marrs
I do see that picking up the incorrect ID, which is why we created a stored procedure which returned the affected row. -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 11:13 AM To: David Elliott Cc: Adam Voigt on PHP-DB Subject: Re:

Re: [PHP-DB] Re: Get Last ID Inserted

2002-11-21 Thread John Krewson
Please don't ban more for this example using VB, but this is how I did it a while ago in VB/ASP, generating and setting the RecID in one stroke. I assume you could just wrap this in PHP and it would work just as well. strSQL=Select newid() RecID =

[PHP-DB] MySQL Problem

2002-11-21 Thread Griffiths, Daniel
Hi, I have a problem with an MySQL statement that is driving me mad, I'm using php to connect to the database. this is it : - SELECT LINE,SUM(IF(MONTH=2,WB.TEU,0)) AS '2' ,SUM(IF(MONTH=3,WB.TEU,0)) AS '3' ,SUM(IF(MONTH=4,WB.TEU,0)) AS '4' ,SUM(IF(MONTH=5,WB.TEU,0)) AS '5'

RE: [PHP-DB] MySQL Problem

2002-11-21 Thread Michael Hazelden
Maybe I'm missing something - but the MySQL statement looks right ... How are you displaying the results? -Original Message- From: Griffiths, Daniel [mailto:[EMAIL PROTECTED]] Sent: 21 November 2002 16:37 To: PHP List Subject: [PHP-DB] MySQL Problem Hi, I have a problem with an MySQL

RE: [PHP-DB] inserting html into mysql tables

2002-11-21 Thread Hutchins, Richard
You're also, at the very least, going to want to escape out the characters in the HTML code that could cause problems with your query (e.g. , '). To do this, you'd use the addslashes() function prior to inserting the data into the database. -Original Message- From: Adam Voigt

RE: [PHP-DB] MySQL Problem

2002-11-21 Thread Griffiths, Daniel
the statement runs without errors, its just the output thats wrong (see the two tables) I'm displaying the results by doing a simple dump of the query, through my own code and have also tried through phpMyAdmin. -Original Message- From: Michael Hazelden [mailto:[EMAIL PROTECTED]] Sent:

RE: [PHP-DB] MySQL Problem

2002-11-21 Thread Jason Vincent
Still think we need to see the PHP code before determining that it is an SQL problem. Regards, J -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 11:55 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL Problem On Friday 22 November

RE: [PHP-DB] MySQL Problem

2002-11-21 Thread Griffiths, Daniel
the month starts at 1, at the moment I'm just hard coding the month into the statment. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 21 November 2002 16:55 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL Problem On Friday 22 November 2002 00:46, Griffiths,

[PHP-DB] Re: Get Last ID Inserted

2002-11-21 Thread David Elliott
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Adam On 21 November 2002 at 11:12:46 -0500 (which was 16:12 where I live) Adam Voigt rearranged electrons to get But if there are heavy operations on the site, will this not also pick up a different last inserted id, if in the split

Re: [PHP-DB] Re: Get Last ID Inserted

2002-11-21 Thread Adam Voigt
Ahh, thanks very much. On Thu, 2002-11-21 at 12:08, David Elliott wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Adam On 21 November 2002 at 11:12:46 -0500 (which was 16:12 where I live) Adam Voigt rearranged electrons to get But if there are heavy operations on the site,

[PHP-DB] php_mcrypt

2002-11-21 Thread Ryan Jameson (USA)
Has anyone gotten php_mcrypt working with the latest version of php on win32? Ryan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Re: Get Last ID Inserted

2002-11-21 Thread Micah Stevens
From the MySQL docs: The most recently generated ID is maintained in the server on a per-connection basis. It will not be changed by another client. It will not even be changed if you update another AUTO_INCREMENT column with a non-magic value (that is, a value that is not NULL and not 0). So

RE: [PHP-DB] Check data exists in MySQL

2002-11-21 Thread Adam Royle
Sorry about previous post (some stupid shortcut key made it send) Your row: $sql = INSERT INTO count VALUES('$dept', '$deptsub', '0'); should be: $sql = INSERT INTO count VALUES('$dept', '$deptsub', '0'); You missed the double quotes. Adam --- Original Message --- Hi, for some reason

[PHP-DB] arrays

2002-11-21 Thread Martin Allan Jensen
Hi everyone, I have a problem sorting my data, I have an array with a flush of values and years from a mysql database. When i have all the values i need php to only print the values, and then group it by year souch that if i had an array that looked like this: Array([2002] = 20,[2002] =

RE: [PHP-DB] FW: Selecting not on DB

2002-11-21 Thread John W. Holmes
Hi there, I have a problem that I cannot seem to solve. I'm using MySql and query it using PHP. I have create table ABC with field called number containing (1,4,6,10) How is to select all number form 1 to 10 which are not in that field so the output somehow like this : ++ |

[PHP-DB] INSERT question. 2 pointers.

2002-11-21 Thread Amit_Wadhwa
hi Scott, 1. When you are using an insert where you dont want to use all columns: use this: $query = INSERT INTO accounts VALUES('.$accnts[0].', 'TIMESTAMP(10)','','','','',); (never have empty comma strings with nothing inside.) 2. Secondly, when you get errors, and you dont know where the

[PHP-DB] UPDATE mySQL database with IF condition

2002-11-21 Thread Ravi Ramroop
Hi.. I'm having some problem with an if condition when I'm trying to insert data into a mysql table.. the script works fine with no parse errors..but the table doesn't get updated like I want it to be.. and i'm almost certain that the code is correct... Here is part of the script.. I have a form

RE: [PHP-DB] Help with Date

2002-11-21 Thread John W. Holmes
Is there a way to convert a date 20/11/2002 to a Float number in PHP, since the date starts in 30/12/1899, just like the delphi treats the dates Yeah, of course. To convert 20/11/2002 into a float, just do echo (float)20/11/2002; and you get 20!! Or you can use strtotime() to convert