php-general Digest 1 Dec 2001 21:02:02 -0000 Issue 1027

Topics (messages 76300 through 76322):

Re: file_exists problems
        76300 by: faeton
        76305 by: Prolog
        76306 by: faeton
        76320 by: Fred

Re: call_user_func problem
        76301 by: faeton
        76310 by: Papp Gyozo

Re: Don't tell me this isn't possible (object related question)
        76302 by: Matt McClanahan

Re: Getting the filesize of an image?
        76303 by: Matt McClanahan
        76304 by: faeton
        76322 by: Matt McClanahan

Question per install. Editing apxs (linux)
        76307 by: Joelmon2001.aol.com

Preventing a form from being submitted twice
        76308 by: rdkurth.starband.net
        76311 by: [ Swift eNetwork ]
        76313 by: rdkurth.starband.net
        76314 by: Robert Samuel White

[광고] 유용한 정보입니다!!!
        76309 by: 웹미디어스쿨

PHP & credit validation
        76312 by: Daniel Guerrier

Stripping slashes from db-insert?
        76315 by: Daniel Alsn
        76316 by: Shane Wright

Re: XML and PHP - dynamic hell
        76317 by: Matthew Loff
        76318 by: Chris

LOAD DATA INFILE help
        76319 by: Tyler Longren
        76321 by: Fred

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hello Prolog,


Hm... And what about:
print '<img src="/images/$filename">';
instead of readfile?


P>  if(file_exists(/images/$filename))
P>  {
P>   readfile(/images/$filename);
P>  }
P>  else
P>  {
P>   readfile(images/npat.jpg);
P>  }



------------------------------------------------
Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
::: 鸞迪 桎蟻惟 裔前疾嶢 脣穽前, 魏 汁暹 穽前 裔愉昌潗. :::

--- End Message ---
--- Begin Message ---
I've since tried that also.  It too seems to return the same error.  I'm
curious if the file_exists can't use relative positions....like it has to be
in the same folder or you have to use the whole line like c:\....  I'm
working on a box that isn't mine of the net...if that's the case I don't
know my full directory line.  Just a thought but I'm not sure.  I'll include
my full code below...as it sits now.  Maybe you can see something that I
can't.....

-----

<?php

//connect to DB

include ('connect.php');

//Query MySQL DB

$result = mysql_query("SELECT * FROM ar
   LEFT JOIN company on ar.company_id=company.company_id
   LEFT JOIN scale on ar.scale_id=scale.scale_id
   WHERE stock_status = 0
   order by ar.driver_number");


//gather results

if ($myrow = mysql_fetch_array($result)) {

//start table

  echo "<table border=1>\n";

  echo "<tr><td>Image</td><td>Info</td></tr>\n";

  do {

 //filename is the item number + t.jpg -- t shorthand for thumbnail

   $picname = "$itemnumber t.jpg";

     print ("<tr><td><center>");

 //if the file exists then print it.  Otherwise print a generic image saying
it doesn't exist.

 if (file_exists ("/images/$picname t.jpt")
 {
  print ('<img src=\"/images/ . $picname . t.jpt\">');
  print ("<center></td><td><center><a href=\"drivers.php?driver=$dn\"> $dn
</a><br> $sp - $val <br> $size : \$$price<br>Release: $release <br> <a
href=\"cart.php?item=$itemnumber\">Preorder This
Item</a></center></td></tr>\n");
 }
 else
 {
  print ("<img src=\"/images/npat.jpt\">");
  print ("<center></td><td><center><a href=\"drivers.php?driver=$dn\"> $dn
</a><br> $sp - $val <br> $size : \$$price<br>Release: $release <br> <a
href=\"cart.php?item=$itemnumber\">Preorder This
Item</a></center></td></tr>\n");

 }


  }
  while ($myrow = mysql_fetch_array($result));

  print ("</table>\n)";

  //if no results found display this message
}
else
{

  echo "Sorry, no records were found!";

}

$dn = "$myrow["driver_name"]";
$sp = "$myrow["sponsor"]";
$val = "$myrow["value"]";
$size = "$myrow["size"]";
$price = "$myrow["price"]";
$release = "$myrow["release"]";
$itemnumber = "$myrow[item_number]";
?>

-----

maybe that will help.

-Jordan

"Faeton" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello Prolog,
>
>
> Hm... And what about:
> print '<img src="/images/$filename">';
> instead of readfile?
>
>
> P>  if(file_exists(/images/$filename))
> P>  {
> P>   readfile(/images/$filename);
> P>  }
> P>  else
> P>  {
> P>   readfile(images/npat.jpg);
> P>  }
>
>
>
> ------------------------------------------------
> Ivan 'Faeton aka xetrix' Danishevsky
> ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
> ::: 鸞迪 桎蟻惟 裔前疾嶢 脣穽前, 魏 汁暹 穽前 裔愉昌潗. :::
>


--- End Message ---
--- Begin Message ---
Hello Prolog,

If course it doesn't use relative positioning.
You should do it like that file_exists("images/...") instead of
("/images/..."). That's all :)



P> I've since tried that also.  It too seems to return the same error.  I'm
P> curious if the file_exists can't use relative positions....like it has to be
P> in the same folder or you have to use the whole line like c:\....  I'm
P> working on a box that isn't mine of the net...if that's the case I don't
P> know my full directory line.  Just a thought but I'm not sure.  I'll include
P> my full code below...as it sits now.  Maybe you can see something that I
P> can't.....


------------------------------------------------
Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
::: 珞莘厓 疾 調裔 禎涯茵... 鮫孼 埰診... :::

--- End Message ---
--- Begin Message ---
file_exists takes a string argument.
/images/$filename is not a string.
try "images/" . $filename instead.

Fred

Prolog <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I had a script that was running beautiful that simply called up a database
> and displayed the results in tables.  I went to add images to this script
> and all hell broke loose.  This is the portion of the script that I added:
>
>
> ----------
>
> file://filename is the item number + t.jpg -- t shorthand for thumbnail
>
>   $itemnumber = "$myrow[item_number]";
>   $filename = "$itemnumber t.jpg";
>
>     echo "<tr><td><center>";
>
> file://if the file exists then print it.  Otherwise print a generic image
saying
> it doesn't exist.
>
>  if(file_exists(/images/$filename))
>  {
>   readfile(/images/$filename);
>  }
>  else
>  {
>   readfile(images/npat.jpg);
>  }
>
> ---------
>
> Is there anything I need to know about "file_exists" that I'm not doing.
> for some reason when this code is added it gives me an error on the line
> after the close of the else statement.  That line was perfectly fine
before
> the addition.  Please help.
>
> -Jordan
>
>


--- End Message ---
--- Begin Message ---
Hello C,


That means that you should create a .htaccess file containing that:

php_value allow_call_time_pass_reference 1

That should work :)

C> Prior to 4.0.6 it worked fine, however, now when I try:

C> $result = call_user_func("foo", &$bar);

C> function foo( &$bar ) {
C>    $bar .= 'foobar';
C>    return 1;
C> }

C> I get this:

C> Warning: Call-time pass-by-reference has been deprecated - argument passed
C> by value; If you would like to pass it by reference, modify the declaration
C> of call_user_func(). If you would like to enable call-time
C> pass-by-reference, you can set allow_call_time_pass_reference to true in
C> your INI file. However, future versions may not support this any longer.

C> Does that mean I can't pass by reference anymore? I kinda need to (the two
C> functions above are not my actual functions btw)....


------------------------------------------------
Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
::: 卵佺 禎 鴨p億 張 乙裔. 絞 溢y, 狀 撓 依茵奄. :::

--- End Message ---
--- Begin Message ---
| That means that you should create a .htaccess file containing that:
| 
| php_value allow_call_time_pass_reference 1
| 
| That should work :)

But as the errormessage mentioned it may not supported in future version.
I think if you declare your function arguments to be passed by variables
then you don't need to explicitly set it in call-time.

does it work? (i've not tried yet.)

$result = call_user_func("foo", $bar);
function foo( &$bar ) {
   $bar .= 'foobar';
   return 1;
}


| 
| C> Prior to 4.0.6 it worked fine, however, now when I try:
| 
| C> $result = call_user_func("foo", &$bar);
| 
| C> function foo( &$bar ) {
| C>    $bar .= 'foobar';
| C>    return 1;
| C> }
| 
| C> I get this:
| 
| C> Warning: Call-time pass-by-reference has been deprecated - argument passed
| C> by value; If you would like to pass it by reference, modify the declaration
| C> of call_user_func(). If you would like to enable call-time
| C> pass-by-reference, you can set allow_call_time_pass_reference to true in
| C> your INI file. However, future versions may not support this any longer.
| 
| C> Does that mean I can't pass by reference anymore? I kinda need to (the two
| C> functions above are not my actual functions btw)....
| 
| 
| ------------------------------------------------
| Ivan 'Faeton aka xetrix' Danishevsky
| ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
| ::: Ńëîíű ďî äĺpĺâü˙ě íĺ ëŕçŕţň. Îíč ěîăyň, íî čő ëîěŕĺň. :::
| 
| 
| -- 
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
| 
--- End Message ---
--- Begin Message ---
On Sat, Dec 01, 2001 at 12:15:37AM +0100, Jeroen Olthof wrote:

> let's say I have made some objects
> $content = new Content();
> 
> and in object content a new object is created
> $person = new Person("Jeroen");
> 
> Person holds a var age
> 
> Now I want to do something like this in a normal PHP script
> 
> echo $content->getPerson("Jeroen")->getAge();
> or since PHP doesn't use private / prublic / etc..
> echo $content->getPerson("Jeroen")->age;
> 
> the point is , getPerson("Jeroen") returns an object. this object contains
> the function getAge() which return the var age
> but somehow this constuction isn't possible !!!! ????? Why !!!!
> ....... or is it but is there a strange syntax ????

As someone else already mentioned, this isn't in PHP yet.  But it's coming. 
In the mean time, you have a couple options.  If you only have one Person
inside a Content, you can simply say $content->person->age;  If you have
more than one, they could be arranged in an array, so it becomes
$content->person['Jeroen']->age;

Another option is to define a method in Content which returns $person->age.

Matt
--- End Message ---
--- Begin Message ---
On Fri, Nov 30, 2001 at 07:04:08PM -0500, Uchendu Nwachukwu wrote:

> Is there any easy way to get the filesize of an image on a remote server?
> 
> Please tell me there is! TIA

It scares me that nobody has answered with filesize() yet.

Matt
--- End Message ---
--- Begin Message ---
Hello Matt,

filesize() works only on local filesystems.

MM> It scares me that nobody has answered with filesize() yet.
MM> Matt


------------------------------------------------
Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com
::: Documentation - The worst part of programming. :::

--- End Message ---
--- Begin Message ---
On Sat, Dec 01, 2001 at 09:55:47AM +0200, faeton wrote:

> Hello Matt,
> 
> filesize() works only on local filesystems.

If you want the size of a remote file, you'll have to download it; HTTP
doesn't provide a way to query a remote file's size.  FTP does, if you have
FTP access.

Matt
--- End Message ---
--- Begin Message ---
One source for raq 3 users like myself said to edit it for php and do this:
        Line 203:
        ($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+S+W+iaA",
@ARGV);
        This line should read as I have above. Normally its:
        ($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+iaA", @ARGV);
            [in other words, remove the +S ]


Ok, Remove the +S. Fine. However, another site said:

#fix apxs so that it can use the -S option
wget http://www.uk2raq.com/updates/php/apxs
mv apxs /usr/sbin/apxs
chmod 755 /usr/sbin/apxs    

That was interesting.

What is the difference between the 2 options?

Thanks. I hope this is not off topic, as it's per installing php

Joel



--- End Message ---
--- Begin Message ---
How can I prevent somebody from using the back button after they fill
in a form and it takes them to a second page that checks there data
using php code. I don't what them to be able to resubmit the info a
second time with different information to be able to get the data that
they are buying. Hope this makes since to what I am asking



-- 
Best regards,
 rdkurth                          mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Two Words:  Session Management

> How can I prevent somebody from using the back button after they fill
> in a form and it takes them to a second page that checks there data
> using php code. I don't what them to be able to resubmit the info a
> second time with different information to be able to get the data that
> they are buying. Hope this makes since to what I am asking
> 
> 
> 
> -- 
> Best regards,
>  rdkurth                          mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
[EMAIL PROTECTED]
> 
> 
> 


--- End Message ---
--- Begin Message ---
could you give me a few more words to point me in the right direction

Saturday, December 01, 2001, 1:41:49 AM, you wrote:

Se> Two Words:  Session Management

>> How can I prevent somebody from using the back button after they fill
>> in a form and it takes them to a second page that checks there data
>> using php code. I don't what them to be able to resubmit the info a
>> second time with different information to be able to get the data that
>> they are buying. Hope this makes since to what I am asking
>> 
>> 
>> 
>> -- 
>> Best regards,
>>  rdkurth                          mailto:[EMAIL PROTECTED]
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: php-list-
Se> [EMAIL PROTECTED]
>> 
>> 
>> 




-- 
Best regards,
 rdkurth                            mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Well, that's kinda hard to do.  You should start by looking at the
session management functions of PHP.  Then, track your sessions by
creating a table in a database.  Then, once you are doing that...you
will have a session id associated with any individual using your
website.  Once that individual submits an entry, save the session id
with the order and don't allow them to submit another order since their
session id is already stored.

-OR-

If you only want them to be able to submit ONE ORDER EVER, then create a
cookie on their computer (that lasts for a year) once they have
completed the transaction and check for the cookie every time someone
tries to submit an order.  IF the cookie exists, then prevent the order
from processing.

Hope this helps.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, December 01, 2001 4:51 AM
To: php-general
Subject: Re[2]: [PHP] Preventing a form from being submitted twice


could you give me a few more words to point me in the right direction

Saturday, December 01, 2001, 1:41:49 AM, you wrote:

Se> Two Words:  Session Management

>> How can I prevent somebody from using the back button after they fill

>> in a form and it takes them to a second page that checks there data 
>> using php code. I don't what them to be able to resubmit the info a 
>> second time with different information to be able to get the data 
>> that they are buying. Hope this makes since to what I am asking
>> 
>> 
>> 
>> --
>> Best regards,
>>  rdkurth                          mailto:[EMAIL PROTECTED]
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: php-list-
Se> [EMAIL PROTECTED]
>> 
>> 
>> 




-- 
Best regards,
 rdkurth                            mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---

 
--- End Message ---
--- Begin Message ---
What credit service(s) can intergrate with PHP

__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com
--- End Message ---
--- Begin Message ---
Hi,

i know this has been asked before - but:

When i add entries to MySql (varchar and text) all " and ' gets a slash in
front of them. How do i get rid of these slashes?

Regards
# Daniel Alsn    | www.mindbash.com #
# [EMAIL PROTECTED]  | +46 704 86 14 92 #
# ICQ: 63006462   | +46 8 694 82 22  #
# PGP: http://www.mindbash.com/pgp/  #

--- End Message ---
--- Begin Message ---

Addslashes() is probably getting called twice on the data on the insert...

if you have magic_gpc on, any inputted data already has the necessary escapes 
- so you shouldnt need to call it again...

Hope that helped :)

--
Shane

On Saturday 01 Dec 2001 1:14 pm, Daniel Alsn wrote:
> Hi,
>
> i know this has been asked before - but:
>
> When i add entries to MySql (varchar and text) all " and ' gets a slash in
> front of them. How do i get rid of these slashes?
>
> Regards
> # Daniel Alsn    | www.mindbash.com #
> # [EMAIL PROTECTED]  | +46 704 86 14 92 #
> # ICQ: 63006462   | +46 8 694 82 22  #
> # PGP: http://www.mindbash.com/pgp/  #
--- End Message ---
--- Begin Message ---

Did you try adding:

header("Content-Type: text/xml");

To the top?


-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, December 01, 2001 12:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] XML and PHP - dynamic hell


I'm having one page output XML for other sites to parse. Unfortunately
if I
give an RSS parser the site (the php file) it errors out. But if I put
the
output in a XML file, and give that to the RSS parser everything works
perfectly. Does anyone know why it can't read it straight from the php
file?
PHP Builder has it working, I have no idea why mine doesn't. Thanks

Source:

<?
require "division/settings.inc";
require RootPath . "admin/Admin.php";  //these just define mysql logins
and
such
echo "<" . "?xml version=\"1.0\"?" . ">\n";
echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS
0.91//EN\"
\"http://my.netscape.com/publish/formats/rss-0.91.dtd\";>\n";
echo "<rss version=\"0.91\">\n";
echo "<channel>\n";
  $query = mysql_query("Select * from " . PREFIX . "news order by Date
Desc
Limit 40");
  while($results = mysql_fetch_array($query))
  {
   echo "<item>\n";
   echo "<title>" . stripslashes($results["Subject"]) . "</title>\n";
   echo "<link>http://dod.stronger.org/</link>\n";
   echo "<author>$results[Name]</author>\n";
   echo "<description>" .
substr(htmlspecialchars(stripslashes($results["News"])),0,150) .
"...</description>\n";
   echo "</item>\n";
 }
?>
  </channel>
</rss>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
It didn't help :(
----- Original Message ----- 
From: "Matthew Loff" <[EMAIL PROTECTED]>
To: "'Chris'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, December 01, 2001 10:03 AM
Subject: RE: [PHP] XML and PHP - dynamic hell


> 
> Did you try adding:
> 
> header("Content-Type: text/xml");
> 
> To the top?
> 
> 
> -----Original Message-----
> From: Chris [mailto:[EMAIL PROTECTED]] 
> Sent: Saturday, December 01, 2001 12:34 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] XML and PHP - dynamic hell
> 
> 
> I'm having one page output XML for other sites to parse. Unfortunately
> if I
> give an RSS parser the site (the php file) it errors out. But if I put
> the
> output in a XML file, and give that to the RSS parser everything works
> perfectly. Does anyone know why it can't read it straight from the php
> file?
> PHP Builder has it working, I have no idea why mine doesn't. Thanks
> 
> Source:
> 
> <?
> require "division/settings.inc";
> require RootPath . "admin/Admin.php";  //these just define mysql logins
> and
> such
> echo "<" . "?xml version=\"1.0\"?" . ">\n";
> echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS
> 0.91//EN\"
> \"http://my.netscape.com/publish/formats/rss-0.91.dtd\";>\n";
> echo "<rss version=\"0.91\">\n";
> echo "<channel>\n";
>   $query = mysql_query("Select * from " . PREFIX . "news order by Date
> Desc
> Limit 40");
>   while($results = mysql_fetch_array($query))
>   {
>    echo "<item>\n";
>    echo "<title>" . stripslashes($results["Subject"]) . "</title>\n";
>    echo "<link>http://dod.stronger.org/</link>\n";
>    echo "<author>$results[Name]</author>\n";
>    echo "<description>" .
> substr(htmlspecialchars(stripslashes($results["News"])),0,150) .
> "...</description>\n";
>    echo "</item>\n";
>  }
> ?>
>   </channel>
> </rss>
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

--- End Message ---
--- Begin Message ---
Hello everyone,

I posted this message to the mysql mailing list and didn't get a response.
I know a lot of people here are good with SQL.  So, here's my e-mail:

Hello,

I've been struggling with this all night.  Can someone give me a push in the
right direction?  I
have a csv file named Sheet1.txt, here's an example of its contents:
"P1002565",
"P1002566",
"P1002638",

I want to put the contents of Sheet1.txt in a table named 'passcodes'.  The
passcodes table has 2 fields: 'id' and 'passcode'.  I run this:
LOAD DATA INFILE 'Sheet1.txt' INTO TABLE passcodes FIELDS TERMINATED BY ','
ENCLOSED BY '"' LINES TERMINATED BY '\n';

Nothing gets inserted into the 'passcode' field, but ID's are generated for
every item in Sheet1.txt.

Can anyone give me some help?  Sorry for the sort of off-topic question!

Thanks,
Tyler Longren

--- End Message ---
--- Begin Message ---
It makes a huge difference if the order of fields is different in your text
file than it is in your mysql table.  For instance, if your mysql table has
id before passcode (assuming id is an autoincrement field), then every time
you try to load data from this file it grabs the passcode (which is first in
the file) and inserts it as an id (which is first in the table).  Since the
id is an autoincrement column it simply generates an id and ignores the
passcode.  Since there is only one field per line in your text file there is
nothing left to insert into the table's passcode column.

If that is the case then you need to add (passcode) tot he end of your query
so that mysql knows that the fields in the text file are to be inserted in
the passcode column.  mysql will then insert an id and the passcode for each
row.

Fred

Tyler Longren <[EMAIL PROTECTED]> wrote in message
003301c17a94$ac453610$0101a8c0@Longren">news:003301c17a94$ac453610$0101a8c0@Longren...
> Hello everyone,
>
> I posted this message to the mysql mailing list and didn't get a response.
> I know a lot of people here are good with SQL.  So, here's my e-mail:
>
> Hello,
>
> I've been struggling with this all night.  Can someone give me a push in
the
> right direction?  I
> have a csv file named Sheet1.txt, here's an example of its contents:
> "P1002565",
> "P1002566",
> "P1002638",
>
> I want to put the contents of Sheet1.txt in a table named 'passcodes'.
The
> passcodes table has 2 fields: 'id' and 'passcode'.  I run this:
> LOAD DATA INFILE 'Sheet1.txt' INTO TABLE passcodes FIELDS TERMINATED BY
','
> ENCLOSED BY '"' LINES TERMINATED BY '\n';
>
> Nothing gets inserted into the 'passcode' field, but ID's are generated
for
> every item in Sheet1.txt.
>
> Can anyone give me some help?  Sorry for the sort of off-topic question!
>
> Thanks,
> Tyler Longren
>


--- End Message ---

Reply via email to