For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > June 2004 > Instert into Problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Instert into Problem
Arouraios

2004-05-22, 8:30 pm

I have a script that open some files on a diretory "read
them" and display their stats to the screen. When i am trying to
write this stats to mysql database, it only write the last value.

Example.
sql = mysql_query(" INSERT INTO `external` ( `id` , `size`
, `letters` , `number` , `visible` ) VALUES ('id',
'file[length]', 'file[letters]',
'file[numbers]','yes') ");

In the directory i have 10 txt files. It display all the files to the
screen corectly with their stats but it only write inside the
database the last file-stats.

Any help???




----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums


Vigil

2004-05-23, 8:32 am

On Sat, 22 May 2004 18:45:23 -0500, Arouraios wrote:

> It display all the files to the
> screen corectly with their stats but it only write inside the database
> the last file-stats.


Sounds like the SQL insert is outside of the loop.

--

..

Arouraios

2004-05-23, 10:30 am

How i put it inside the loop???



----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums


RootShell

2004-06-03, 7:08 pm

place the code to insert into the MySQL inside the LOOP where you SHOW the
files onscreen.

RootShell

"Arouraios" <webmaster@hyperpress-dot-gr.no-spam.invalid> wrote in message
news:a6idnT0keNptNy3dRVn_vA@giganews.com...
> How i put it inside the loop???
>
>
>
> ----------------------------------------
> The post originated from PHP Freaks:
> ----------------------------------------
> http://www.phpfreaks.com
> http://www.phpfreaks.com/forums
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com