RE: [PHP-DB] % operator

2003-08-14 Thread Matthew Moldvan
Well, it looks like your previous response was correct, but $a%$b in this
case returns 4, not the 0.8 as intended ... fmod($a, $b) (I have php 4.1.2,
so I can't test fmod()) will probably return 0.8 though.

As a side note, this message seems a little off-topic ... though it is PHP,
it has nothing to do with databases. :)

Regards,
Matt.

-Original Message-
From: Andrew D. Luebke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 3:04 PM
To: 'Alain Barthélemy'; php-db
Subject: RE: [PHP-DB] % operator


Although now that I look at: 
http://us4.php.net/manual/en/language.operators.arithmetic.php

You'll see that $a % $b resturns the modulus so that is probably the
easiest.

Andrew,

At 11:43 AM 8/12/2003, you wrote:

There's probably a better way to do this, but to retrieve only the 0.8 from
24/5 try this:

($a/$b)-floor($a/$b)

Regards,
Matt.

-Original Message-
From: Alain Barthélemy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 5:05 AM
To: php-db
Subject: [PHP-DB] % operator


Hello,

If you have

$a = 24;
$b = 5;

and

$c = $a/$b;

=== $c = 4.8

To retrieve the .8 (reste in french) I saw instruction:

$a%$b

Where can I find a manual for this '%' operator? Of course I already looked
in
all the Php manuals (operators, etc ...).

Thanks,



--
Alain Barthélemy
[EMAIL PROTECTED]
http://bartydeux.be
Linux User #315631


--
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread CPT John W. Holmes
From: Dillon, John [EMAIL PROTECTED]

 While doing a cross tabulation, I've got a query which gives me a variable
 number of fields:

Maybe mysql_num_fields() and mysql_field_name() will be of use, here? Check
the manual..

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Functions - scope of returned result

2003-08-14 Thread Dillon, John
To answer my own question again, I didn't assign the returned value from the
function call to a variable:

$piv_result=queries();

All OK.

-Original Message-
From: Dillon, John [mailto:[EMAIL PROTECTED]
Sent: 14 August 2003 17:54
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Functions - scope of returned result


One more bite on this code.  

function queries(){
//code..
$piv_result=mysql_db_query($db, $query, $connection) or die (Query9
failed: $query);
return $piv_result;
}

function print(){
global $piv_result;
$count_fields=mysql_num_fields($piv_result);  //ERROR: 
//code...
}

//MAIN 
queries();
print();

Should this work - $piv_result is being returned from one function and then
being used in another function.  Am I missing something?

John































   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any,
are confidential. If you are not the named recipient please notify the
sender and immediately delete it. You may not disseminate, distribute, or
forward this e-mail message or disclose its contents to anybody else.
Copyright and any other intellectual property rights in its contents are the
sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message which arise as a result of e-mail
transmission.  If verification is required please request a hard-copy
version.
 Although we routinely screen for viruses, addressees should check this
e-mail and any attachments for viruses. We make no representation or
warranty as to the absence of viruses in this e-mail or any attachments.
Please note that to ensure regulatory compliance and for the protection of
our customers and business, we may monitor and read e-mails sent to and from
our server(s). 

For further important information, please read the  Important Legal
Information and Legal Statement at
http://www.cantor.com/legal_information.html


-- 
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] Functions - scope of returned result

2003-08-14 Thread John W. Holmes
Dillon, John wrote:
One more bite on this code.  

function queries(){
//code..
$piv_result=mysql_db_query($db, $query, $connection) or die (Query9
failed: $query);
return $piv_result;
}
function print(){
	global $piv_result;
	$count_fields=mysql_num_fields($piv_result);  //ERROR: 
	//code...
}

//MAIN 
queries();
print();

Should this work - $piv_result is being returned from one function and then
being used in another function.  Am I missing something?
Yes, you're returning the result set, but you're not assigning it anywhere.

$rs = queries();
print($rs);
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] DBX or PEAR::DB?

2003-08-14 Thread Juliano
Hi!

Can somebody explain me what's the difference between PEAR::DB and the DBX extension 
included in PHP?

Thanks
Juliano

RE: [PHP-DB] adding integer to field in query

2003-08-14 Thread Dillon, John
Thanks to both responses.  In fact, it decided to work once I put 0 in the
cell that 1 was to be added to!  It seems it got it started..  1+NULL=?

-Original Message-
From: Matt Schroebel [mailto:[EMAIL PROTECTED]
Sent: 13 August 2003 15:48
To: Dillon, John; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] adding integer to field in query


Dillon, John mailto:[EMAIL PROTECTED]  wrote on Wednesday, August
13, 2003 10:24 AM:

 How do you add a number to a field within the query, ie
 without having to
 extract?  Eg
 
 $query=UPDATE Choice SET visits=(visits+1) WHERE ID='$thisID';
 
 is the above visits=(visits+1) legal, cos it doesn't work
 at the moment?
 

It's executing right?  Echo out your query statement and see what you're
asking for.


   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] using PHP to find out Windows user name?

2003-08-14 Thread Chen, Mao
Hi Everyone,

 

I'm just wondering whether we can use PHP to find out the name of user
who is currently logging on to local Windows computer and accessing a
particular .php web page.

 

Thanks in advance.



[PHP-DB] PostgreSQL connection

2003-08-14 Thread Joe Nilson Zegarra Galvez
Hi all, i have a question, i have a php file with all my class to
connect into a postgresql db and i'm using the pg_connect in this form:

pg_connect(192.168.1.100$dbase);

but when i have 8 or 10 users inserting data the db response is very
slow, is problem in the pg_connect?, all ppl use the same file_class.php
to connect to the db.

The SErver is a Compaq Proliant with two Xeon 2.20Ghz Processors, 1Gb
Memory, 20Gb SCSI HD, 1Gb Ethernet and Redhat Linux with apache 2.0.47,
php 4.2.2 and PostgreSQL 7.2.2

Thankx for your answers

Regards


Nilson


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Conection to MS SQL 2000 from PHP in Linux

2003-08-14 Thread Jean Fernando Ortiz
Hi all!
I need to know how I must connect to MS SQL Server 2000 in a Win 2000 Server
from my Internet Server with Linux, PHP 4.0.4 + Apache 1.3.19.

Thanks for your help.

-- 

PEM Jean Fernando Ortiz Arana
Coordinador de TI
Centro Escolar El Roble
APDE - Guatemala



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Maximum execution time of 30 seconds exceeded

2003-08-14 Thread Michael Cortes
Duhhh.  me mike.  me like cumputors.

This is where the honest geek admits his mistakes.

I had a do while loop such as

do {
mysql_query ($qupdate, $link);
$rslterror=mysql_error($link);
$number++
} while ($rslterror!=null);

I was trying to insert a new record with $number being a field requiring a
uniqe number.  If it failed, it should up the number by one and try again.  I
still don't have that working properly, but that wasn't my endless loop
problem.

You may have notice that I used a query ($qupdate) above.   I defined
 $qinsert earlier on in my script and should of used it instead of $qupdate. 
 $qupdate was undefined and therefore caused an edless loop.

Anyway, I fixed my dumb mistake.  If anyone would like to help me with a
better one, maybe you can tell me if I am doing my do while correctly.  It's
only running through once, not getting a succesful insert  and dropping out.

Thanks

On Monday 11 August 2003 02:02 am, Michael Cortes wrote:
 I am using the Konqueror browser and browing to http://localhost/my.php

 Howerver, the script I wrote, doing various queries and lookups, inserts,
 etc..  takes a while to complete.   That is fine with me.  I'll wait.
 However, the server and/or browser will not wait.

 I believe the server is the one which will not wait because I have one
 echo line at the beginning of the script which put a title Udate
 Students athe the top center of the page and that writes then there is a
 pause while the queries are run and then I get the following error in my
 browser

 Fatal error: Maximum execution time of 30 seconds exceeded in
 /var/www/html/student_info/ps2follett.php on line 139


 Can anyone help?

--

Michael Cortes
Fort LeBoeuf School District
34 East Ninth Street
PO Box 810
Waterford PA 16441-0810
814.796.4795


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Sorting issue

2003-08-14 Thread David T-G
Jeff --

...and then Jeff said...
% 
% One last question.
% 
% I changed all the DB values where numbers are used - (varchar - int)

Well, you should only change for those where the numbers are numbers...


% 
% But for the well locations, there are dashes in them, I.E. 10-15-065-22

Exactly.


% 
% With setting the field to int, it only displays the first part.
% 10-15-065-22 shows as 10
% There are also several other fields that use dashes.

Then those are an alphanumeric mixture and should be a varchar.


% 
% If I set it back to varchar, will it sort it right because the numbers are
% separated by an alfa character, or will I have the same problem as before?

If the numbers are padded then it will sort right.  That is, is the 065
holding three places with a zero?  If it's always 2-2-3-2 digits then
sorting will be just fine (just like 00055 would have sorted as you
expected against 14000 in a varchar field).


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP-DB] file upload security issue

2003-08-14 Thread Jennifer Goodie
 I try to learn file uploading in PHP.  I've successfully uploaded a file
 onto my server.  I use move_uploaded_file(tmp_dir/tmp_filename,
 destination_dir/filename) to move the temp file.   The thing is that I
 have to do a chmod 777 destination_dir in order to move the file.  Is
 this bad for security?

Yes, it is.

chown the directory to the user or group that mysql runs under, then it only
needs to be owner or group writable


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] sql or php?

2003-08-14 Thread otherguy
On Tuesday, August 5, 2003, at 05:56  PM, Merlin wrote:

Hi there,

I am wondering if this could be done with mysql and without php, just 
with
sql.
I do have a table with text and another one with pictures.
Now I would like to print out all titles and mark those tests 
containing a
picture with a camera.

I tryed some LEFT JOIN stuff, and grouped it by the picture table. 
Somehow
it returns always yes.

Has anybody a good idea?


It probably can be, but we need to see your table structures to provide 
any sort of useful advice.  Please post these (no data, just the table 
structure) to the list.  I might also recommend reading up on the join 
sytax on the mysql site.  There are some decent examples at the bottom 
in the user comments section.

-Cameron Wilhelm

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] MySQL Returns Error

2003-08-14 Thread Matt Schroebel


 -Original Message-
 From: Jeff [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, August 05, 2003 3:52 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] MySQL Returns Error
 
 
 Oops, my mistake, it's not a blank entry  - it re enters the 
 last entry.
 
 I can hit F5 or click refresh 1000 times and it will enter 
 the last entry
 1000 times.

The simplest thing to do is do a header('Location:
http://your.site.com/someOtherPage.php') after the insert.  That way the
page displayed isn't the one someone will hit refresh on. Otherwise,
perhaps you should do a select to see if the value is already in the db,
and if so, don't insert it again, but perhaps update it, or ignore it.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Sybase Query- Problems with Pound Sign

2003-08-14 Thread Tiberiu Ardeleanu
Try:
$sql = select * from item where \bib#\ = 300;



- Original Message - 
From: Jeremy Peterson [EMAIL PROTECTED]
To: PHP DB [EMAIL PROTECTED]
Sent: Wednesday, August 06, 2003 4:34 AM
Subject: [PHP-DB] Sybase Query- Problems with Pound Sign


 I am having a problem with a query that has a pound sign in it.  The
 results are quite puzzling, it seems like the page doesn't load if the
 query is present.  I have tested this on other tables without the pound
 sign and they work beautifully, seems like the pound sign is the
 troublemaker to me.

 Printing $sql returns the proper sql statement, so what is the
sybase_query
 function doing to the variable?

 My code is at the bottom of this page.

 Thanks,

 Jeremy



 ?php
 include $DOCUMENT_ROOT/include/sybase.inc;

 $syb_connect = syb_connect($syb_server, $syb_user, $syb_pw);

 $sql = select * from item where bib# = 300;
 print sql=$sql;
 $result = sybase_query($sql);

 //print someting;
 while($row = Sybase_Fetch_Assoc($result)){
 extract($row);
 print $tag $textbr;

 }


 ?


 -- 
 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] Sorting issue

2003-08-14 Thread Jeff
Yes duh...

I didn't realize numbers weren't considered characters.
What's the sql entry for numeric characters?

I'm new at this, and figure I'm not doing to bad so far. .

John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Jeff wrote:

  kwo VARCHAR(10) NOT NULL,
  lsd VARCHAR(20) NOT NULL,

 duh

 --
 ---John Holmes...

 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

 PHP|Architect: A magazine for PHP Professionals – www.phparch.com







-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Don't know why query works this way

2003-08-14 Thread Aaron Wolski
Here's some functions I use in my development which save on connect and
query calls for me.

//General Purpose Utilities.
//db_connect connects to the database server and selects the proper
database.
//Arguments: None
//Returns: Nothing


function db_connect() {

mysql_pconnect(localhost,username,password);
mysql_select_db(Database);

}


//db_query queries the database server and returns the results.
//Arguments: SQL query string
//Returns: Query results

function db_query($query) {

return mysql_query($query);

}


//db_fetch returns the next set of results from a db_query.
//Arguments: db_query results variable
//Returns: Next set of query results as an array or 0 if no further
results are present


function db_fetch($results) {

return mysql_fetch_array($results);

}


//db_numrows returns the number of rows selected from a query.
//Arguments: query result
//Returns: number of rows in the query result

function db_numrows($result) {

return mysql_num_rows($result);

}


//Always connect to the database!

db_connect();


Keep these in an include file. The db_connect(); goes at the bottom and
keep the connection open during the routines.


To call db_query you would use it like:

$someQuery = db_query(SELECT * from someTable );
 

to get the results out of the query you would call db_fetch and use it
like:


$someResult = db_fetch($someQuery);

If you needed to return an array you would use it with a while or for
statement like:

While ($someResult = db_fetch($someQuery)) {

}

If you needed to get the number of rows from the query you'd use like:

numRows = db_numrows($someQuery);

or

if (db_numrows($someQuery)  ...)


These are just some thing I use to make my life easier.

Hope it helps




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: August 6, 2003 7:49 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Don't know why query works this way


there are many ways to approach this.
one is, select the db before any of this activity with mysql_select_db
(dbname) then you can run as many queries against this database as you
want.
Until you call that function again with another db name, mysql with
_always_ run against that database.

hth
jd




 

  Michael Cortes

  [EMAIL PROTECTED]To:
[EMAIL PROTECTED]

  euf.net cc:

   Subject:  [PHP-DB] Don't
know why query works this way   
  08/05/2003 11:35

  PM

  Please respond to

  cortesm

 

 





I have been writing my queries like this...

$link = mysql_connect ($host, $username, $password);
$query = insert into $table ('joe', 15);
if ( mysql_db_query($dbname, $query, $link))  { }

But then I was reading that I should use mysl_query instead of
mysql_db_query.
But I was having a problem with where do i put the $dbname.

When I used:

mysql_query ($dbname, $query, $link)

I got an error message saying i had too many arguments.  So I changed it
to:

mysql_query ($query, $link)

I then got an error message saying it didn't know what database I was
connected to.  I finally got around the problem by including the
database
name in the query, like so:

$query = insert into $dbname.$table ('joe', 15);

I shouldn't have to say, but this is a simplified example.  I didn't
want
to
include all the fields, tables, values that the true example has.  The
question is, am I doing this right?  Do I have no choice but to retype
the
$dbname all over the place if I want to use mysql_query?

Thank in advance for any help.


--

Michael Cortes
Fort LeBoeuf School District
34 East Ninth Street
PO Box 810
Waterford PA 16441-0810
814.796.4795

--
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] Re: PHP MSSQL

2003-08-14 Thread Adam Presley
Ok. Special thanks to Robert Twitty for the answer. I started using the TEXT
datatype to achieve long texts of data. However, PHP.INI is configured by
default to limit TEXT datatype retrievals to 4K. Change the mssql.textlimit
in the INI file to suit your purposes, and use the TEXT datatype.

Thanks!

Shaun Bentley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi
 I am currently trying to use PHP and MSSQL together but I am having a
 few problems.

 I can enter data into the Db OK, but when pulling the data back to display
 on the page, the string cuts to around 250 chars. The Db field is VarChar
 6000 and I can see the whole data in the field.

 I have tried pulling the data out as object, array  row but always lose
the
 end.

 Any help please!

 Shaun





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Interbase queries

2003-08-14 Thread Wil van Lierop
Dear Evan,

It depends what you send in your SQL statement ($sqlstmt), as far as i know
Interbase need only commit-statements depending on your I-Base server
setting AUTO-COMMIT=Tue/False. And only then when you send UPDATE queries.
For SELECT statements you dont need a COMMIT. But beware that you left with
an active result set when you do not send a COMMIT.

Kind regards,

Wil
[EMAIL PROTECTED]

Evan Morris [EMAIL PROTECTED] schreef in bericht
news:[EMAIL PROTECTED]
 Hi

 I am new to using PHP with Interbase.

 If I want to issue a query, I use:

 $sth = ibase_query ($dbh, $sqlstmt);

 I am assuming this issues the query to the database, and commits at the
same
 time? Do I need to release anything after having done this, or does it
take
 care of that by itself?

 Thanks

 Evan Morris
 [EMAIL PROTECTED]
 Tel: +27 11 792 2777
 Fax: +27 11 792 2711
 Cell: +27 82 926 3630





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] URGENT BUSINESS RELATIONSHIP

2003-08-14 Thread PRINCESS GRACE ABONIME
The Palace of King of Ogoni Kingdom,
 Ogoni Oil producing community,
 Rivers State Nigeria.


   Dear Sir,

 I am Princess Grace , daughter of HRH King Solomon
 Abonime, the king of Ogoni Kingdom.  I am 25 years old
 and a graduate of Mass Communication.
 My father was the king of Ogoni Kingdom the highest
 oil producing area in Nigeria.  He was in charge of
 reviving royalties from the multi-national oil
 companies and government on behalf of the oil
 producing communities in Nigeria.  After the hanging of the
 Ogoni Nine(9) including Ken Saro Wiwa by the late
 dictator General Sani Abacha, my father suffered
 stroke and died in August27th last year.  But before
 his death, he called me and told me he has Nine Million
 Five Houndread Thousand Dollars
 (USD9,500,000.00) cash in his possession, specially
 deposited in a Security vault company here.

 He advised me not to tell anybody except my mother who
 is the last wife of the (8) eight wives that he
 married.  My mother did not bear any male child for
 him.  Which implies that all my father's properties,
 companies e.t.c., we have no share in them because my
 mother has no male child according to African
 Tradition.  My father therefore secretly gave me all
 the relevant documents of the said money, and told me
 that I should use this money with my mother and my
 younger sisters because he knows that tradtionally, if
 he dies we cannnot get anything, as inheritance.
 He importantly advised me that I should seek foreign
 assistannce and that I should not invest this money
 here in Nigeria because of his other wives and male
 children who happen to be my elders.  I am soliciting
 for your immediate assistance to get a Bungalow for
 us, where I will live with my mother and two younger
 sisters and further advise me where and how I will
 invest the balance money overseas, possibly on
 products of your company and other profitable
 ventures.

 I believe that by the special grace of God, you will
 help us move this money out of Nigeria to any country
 of your choice where we can invest this money
 judiciously with you.  You are entitled to a
 reasonable part of this money based on our agreement,
 and God will bless you as you help us.

 PLease i needed you to kindly send me your contact informations[your
office
 phone and fax number including your cell phone where i can reach you at
all
 time for further concrete dicussions regards to further development of
this
 transaction.

 Awaiting your response asap and God bless.

 Regards.

 Princess Grace Abonime



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] full text search in mysql

2003-08-14 Thread Larry E . Ullman
As of Version 4.0.1, MySQL can also perform boolean full-text searches
I am running Mysql 3.x . This sounds like a simple task to me. Is it 
not
implemented in 3.x?

It does not have to be OR, NOR or anything, just AND
I've never tried it, but you might be able to get away with
SELECT columns FROM table WHERE MATCH (column) AGAINST ('caribbean') 
AND MATCH (column) AGAINST ('island');

I don't know if it'll work and it will probably be slow but...

For more information, try reading 
http://www.mysql.com/doc/en/Fulltext_Search.html

Larry

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Sorting issue

2003-08-14 Thread John W. Holmes
Jeff wrote:

Yes duh...

I didn't realize numbers weren't considered characters.
What's the sql entry for numeric characters?
I'm new at this, and figure I'm not doing to bad so far. .
Make them an INT column. It'll hold numbers up to 2 billion+. Or you can 
use TINYINT which will hold numbers up to 255. Read the MySQL docs for 
more column types...

kwo INT NOT NULL,
lsd INT NOT NULL,
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Sybase Query- Problems with Pound Sign

2003-08-14 Thread Jeremy Peterson
I am having a problem with a query that has a pound sign in it.  The 
results are quite puzzling, it seems like the page doesn't load if the 
query is present.  I have tested this on other tables without the pound 
sign and they work beautifully, seems like the pound sign is the 
troublemaker to me.

Printing $sql returns the proper sql statement, so what is the sybase_query 
function doing to the variable?

My code is at the bottom of this page.

Thanks,

Jeremy



?php
include $DOCUMENT_ROOT/include/sybase.inc;
$syb_connect = syb_connect($syb_server, $syb_user, $syb_pw);

$sql = select * from item where bib# = 300;
print sql=$sql;
$result = sybase_query($sql);
//print someting;
while($row = Sybase_Fetch_Assoc($result)){
extract($row);
print $tag $textbr;
}

?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: MySQL and PHP?

2003-08-14 Thread Chris Berlioz
Read: http://www.mysql.com/products/licensing-examples.html

===


Richard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello

 I hope this is a rumour but I heard that MySQL is now fully GPL which it
 wasn't earlier.
 I think the part used to communicate with the mysql server was lgpl. Does
 this mean that
 when using php with mysql your php scripts have to be licensed under the
gpl
 as well if
 released?

 If this is the case what other free sql databases are there that can be
used
 with php?

 Thanks for reading.





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Breaking down a table field....

2003-08-14 Thread Duane Lakoduk
I think you may already have this, but just another 20 pesos

SELECT Unit, COUNT(Unit) [Quantity]
FROM table
GROUP BY Unit


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 8:52 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Breaking down a table field


Next question
How can I show how many of each there were?
SO now I have 

breafast
lunch
dinner

I want to have

breafast2
lunch   3
dinner  3

etc...
is that just as easy?







[EMAIL PROTECTED]
07/08/2003 14:42

 
To: [EMAIL PROTECTED]
cc: [EMAIL PROTECTED]
Subject:Re: [PHP-DB] Breaking down a table field



SELECT DISTINCT(Unit) from TABLE_NAME;




  
  [EMAIL PROTECTED]
  sungard.com To: [EMAIL PROTECTED] 
 
  cc: 
  08/07/2003 09:37 AM Subject:  [PHP-DB] 
Breaking down a table field 
  
  




I have a table, wth many entries.
Each entry has been asigned a unit to belong to.

I want to list all the units dynamically.
How can I display all the units, without displaying each instance of the
unit?

EG:

Unititem
breakfast   cereal
breakfast   toast
lunch   salad
lunch   sandwich
dinner  steak
dinner  pie
lunch   soup
dinner  lasagne

and so on..
I'd wanna get a list of:
breafast
lunch
dinner

not several instances of each...
how can I do this?

*
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***







-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Free PHP Editor

2003-08-14 Thread Norma Ramirez - TECNOSOFT
Hi all, after look and evaluate  the options that all you kindly recommended, I decide 
to use the free version of Maguma, it has several 
capabilities that makes good, with a bit disadvantages but I think is pretty good. 
Another option is php edit, but unfortunately is not yet available a formal 
version.Thanks for answer my question, it helps me a lot. =)
 

Norma Ramirez



Re: [PHP-DB] Left Join with more than two tables......

2003-08-14 Thread Brent Baisley
The left join works the same for two or more tables.
select * from table1
left join table2 on table1.id=table2.id
left join table3 on table1.id=table3.id
...
Just specify the table you want to join and what to use to join them.

On Tuesday, August 12, 2003, at 03:16 PM, Michael Cortes wrote:

I know that we can ..

select last_name,first_name, table2.school from table1 left join 
table2 on
school_id=bldg_id

Listing all students and giving the school name for all students, if 
they have
one.  If not, it lists the kid anyway and leaves that field blank.

Anyhow, how about multiple tables?  I can't find it with google.

I have :
table1 with the students
table2 with library PINs and an autoincrement id
table3 with a lunch status and an autoincrement id
I want to list all students (I will select just certain fields)  but 
if they
have it, I want to list the PIN from table2 and the lunch status from 
table3.

I can do it as a join but then anystudent who doesn't cross-reference 
gets
left out.  I need to list all students.

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Renaming .htm pages to .php

2003-08-14 Thread Dennis Cole
I would recommend changing them all to .php files. If you ever change
hosts, or servers you might not be able to change them, also it could be
less secure too

==
Dennis Cole @ Sanford Weather - Sanford, MI, USA -
http://weather.oursanford.com
5000 Weather Enthusiasts Can't Be Wrong! www.weathermatrix.net

-Original Message-
From: David Blomstrom [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 04, 2003 2:15 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Renaming .htm pages to .php

At 01:42 AM 8/4/2003 -0400, Dennis Cole wrote:
Also,

You would be best off changing only the one you thing you might need to
use PHP later with, changing Apache to phase all .htm pages can get
really slow is a insect comes about.

I'll probably use server side includes for footers and other elements on

all pages, so I might go ahead and change all the extensions to .php.
But 
you're referring to Plan B - leaving the .htm extensions and just
modifying 
Apache to treat them as .php extensions, right?



-- 
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] Help with formating text from PHP

2003-08-14 Thread Andrew D. Luebke
Well, as one of the last posts said, if you are displaying in a web 
browser, via HTML, you need to insert br tags where you want the text to 
go to the next line.  HTML doesn't respond to /r/n pairs.  So if that is 
how the user types them in (with a enter key at the end of lines) you need 
to replace with br's if there are no EOL's in the original text you need 
to decide on some arbitrary length and insert br at that point.

Andrew

At 12:03 AM 8/10/2003, Budelak wrote:

The text are type into an input field by the user who is nonot a 
programmer at all. This inputt field updates the database that is later 
called up for display.
Bunmi

Andrew D. Luebke wrote:
How are the paragraph breaks represented in the original text?  You have 
have to detect the paragraph breaks and change to a /r/n.
Andrew.
At 11:40 PM 8/9/2003, Budelak wrote:

Hello,
Can someone help with this problem I've been trying to solve but don't 
how to.

I have a field of type longtext that contains text with paragraphs at 
the time of entry.

But when I display this text content, the paragraphs are not shown. 
Everything will just appear in one long text with no paragraph break.

Bunmi Akinmboni

--
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] Problems with input and modify data on a form.

2003-08-14 Thread José Luis Palacios Vergara
I have  a problem with some programs, I am using 4 frames, 3 of them are for
input data, the top frame is using for input information (right now only
alow show existing information), in the middle frame appear information and
with the bottom frame it's possible navigate through the records, I would
like know if somebody can test and see how can I re use the same code for
input new information. I have this using mysql database and php programming
also when you need locate some record you can push the ? and there will
appear a box with the data and that can be order by one field or another and
choose it that will appear on the top frame; if someone find the programs
useful please feel free of use it and also if someone can help me with the
problem. In the next thread I am sending the program.

Thanks

JOSE LUIS PALACIOS VERGARA



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Problems with input and modify data on a form.

2003-08-14 Thread José Luis Palacios Vergara


begin 666 empresa01.zip
[EMAIL PROTECTED])[EMAIL PROTECTED]'[EMAIL PROTECTED]F5S83 Q+G-Q;.1=
MZ8[.)+^;Z#?@@!UC903NL^9K _F!)3R;(DJBDIW948H+OKNDUX*-1MAN8
M)^KG\1MM!(,Z\K!=M1=06L,V,RF64AGG%P=9?V'5O]J?RF;VP_O/['\\[O?
MF;*?WCT%_C+MA\^?OHK\QQG%3HKUPM6;A RQO+K3]?_N/YX\U=V\^[W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?
[EMAIL PROTECTED](;--G*+W1L@([EMAIL PROTECTED]4!PNV:B.]4-*U5W
M'1J*@P,C7,!4#+7*ME4Y4++$V.QG%D-;`1:L`N/?N5DUXY1KVRUJ Z]
MU+1AM3]6(H.OL 6+,^*[EMAIL PROTECTED]@[EMAIL PROTECTED])[EMAIL PROTECTED]
MM/$=7W?2HB6RQZFFRJ$3=\#4SH`2R#%A9\26$9B.88#8?S/L,:P2V4NF
M^/C,M:]%`BD!T\4R00QS@(=HI!4Q7LRH5*ZNJ62VO+ F8M\4?4:%43
[EMAIL PROTECTED] BX(O,*6\FC*$`.R!AQ,0R.RPWAGE.\%D1YE!TW37*:\A$$KQ

Re: [PHP-DB] ODBC Database

2003-08-14 Thread Gerard Samuel
Robert Twitty wrote:

Unless I am mistaken, but isn't there an ODBC driver available for MySQL
called MyODBC?
-- bob

I haven't a clue.  Ill look, maybe it will help me create drivers for my 
DB layer, as I already know MySQL.
Last night I successfully connected to IBM's DB2, but I didnt get far 
past that as I have to figure out,
how to create tables, figure out how it likes its schemas etc, to really 
give it a work out...

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySQL Returns Error

2003-08-14 Thread Jason Wong
On Wednesday 06 August 2003 01:14, Jeff wrote:
 Well I did what you said, and now I get Parse error: parse error,
 unexpected T_ECHO in C:\FoxServ\www\encana_db.php on line 44

Try:

$result = mysql_query($query, $link_id) OR die(mysql_error());

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Byte your tongue.
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Help needed with variable scoping? or mysql problem

2003-08-14 Thread Mike Klein
I've been using JSP for some time now, and thought I'd write a couple of
rdbms explorers (flat tables, simple master/detail paradigm) using other
technologies, like PHP, Cocoon, etc. Well...it's been fun. I have more
working than not. But now I am hung up. I am getting wierd results in a php
script when I simply change the order of some mysql calls.

I'm using php-4.3.2, rh9, and mysql 3.23.

My error is the following (the first line above the Warning below is a dump
of parameters to the showMaster function which is what's bombing):

conn=Resource id #3 databaseName=info tableName=movies fieldName=title
fieldValue=36th Chamber
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /foo/bar/mywebsite/private/database.php on line 107

Line 107 is the first mysql_num_rows call below.

function showMaster($conn, $databaseName, $tableName, $fieldName,
$fieldValue)
{
echo conn=$conn\n;
echo databaseName=$databaseName\n;
echo tableName=$tableName\n;
echo fieldName=$fieldName\n;
echo fieldValue=$fieldValue\n;

This code fails when placed here==
$result = mysql_query(SELECT * FROM $tableName where
$fieldName='$fieldValue', $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo numRows=$numRows\n;


$fields = mysql_list_fields($databaseName, $tableName, $conn);
$numFields = mysql_num_fields($fields);
echo TABLE border=1 width=100%\n;
echo tr;
for($i = 0; $i  $numFields; $i++)
{
printf(td%s/td, mysql_field_name($fields, $i));
}
echo /tr;

The SAME code succeeds when placed here!==
$result = mysql_query(SELECT * FROM $tableName where
$fieldName='$fieldValue', $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo numRows=$numRows\n;


while($myrow = mysql_fetch_array($result))
...rest of method...
}

Any ideas on why this is? When I move the lines above (from
$result=...to...echo 'numRows') down a few lines to just before the
mysql_fetch_array, then everything works. Whazzup?!?


mike klein



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Help with formating text from PHP

2003-08-14 Thread Budelak
You guys thanks for the encouragement.
I finally solved it with this:
?php $text= preg_replace(/(\015\012)|(\015)|(\012)/,nbsp;br /, 
$rsDailynewsDetail-Fields('newsfull')); echo $text; ?

Help came of course from the link Holmes gave.
Thanks.
Budelak wrote:
Yes. Itis with enter key. It will not be possible to pre-determine the 
length as this field is supposed to be a news field.

I'm lost as to how to go about this as the enter key does  not generate 
chr(13) when saving. I'm really lost.

Holmes directed me to http://us2.php.net/nl2br. I'm currently going thru 
it. It seems they all exepected an HTML input.

Bunmi

Andrew D. Luebke wrote:

Well, as one of the last posts said, if you are displaying in a web 
browser, via HTML, you need to insert br tags where you want the 
text to go to the next line.  HTML doesn't respond to /r/n pairs.  So 
if that is how the user types them in (with a enter key at the end of 
lines) you need to replace with br's if there are no EOL's in the 
original text you need to decide on some arbitrary length and insert 
br at that point.

Andrew

At 12:03 AM 8/10/2003, Budelak wrote:

The text are type into an input field by the user who is nonot a 
programmer at all. This inputt field updates the database that is 
later called up for display.
Bunmi

Andrew D. Luebke wrote:

How are the paragraph breaks represented in the original text?  You 
have have to detect the paragraph breaks and change to a /r/n.
Andrew.
At 11:40 PM 8/9/2003, Budelak wrote:

Hello,
Can someone help with this problem I've been trying to solve but 
don't how to.

I have a field of type longtext that contains text with paragraphs 
at the time of entry.

But when I display this text content, the paragraphs are not shown. 
Everything will just appear in one long text with no paragraph break.

Bunmi Akinmboni

--
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


Re: [PHP-DB] Breaking down a table field....

2003-08-14 Thread jeffrey_n_Dyke

SELECT DISTINCT(Unit) from TABLE_NAME;




   

  [EMAIL PROTECTED]
 
  sungard.com To:   [EMAIL PROTECTED]  
 
  cc:  

  08/07/2003 09:37 AM Subject:  [PHP-DB] Breaking down a 
table field   
   

   





I have a table, wth many entries.
Each entry has been asigned a unit to belong to.

I want to list all the units dynamically.
How can I display all the units, without displaying each instance of the
unit?

EG:

Unititem
breakfast   cereal
breakfast   toast
lunch   salad
lunch   sandwich
dinner  steak
dinner  pie
lunch   soup
dinner  lasagne

and so on..
I'd wanna get a list of:
breafast
lunch
dinner

not several instances of each...
how can I do this?

*
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***







-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] RE: Pivot tables

2003-08-14 Thread Dillon, John
Darn, here's the link:

http://www.mysql.com/articles/wizard/print_version.html

-Original Message-
From: Dillon, John 
Sent: 11 August 2003 19:09
To: [EMAIL PROTECTED]
Subject: Pivot tables



Here is the worth-reading mysql answer to my question below.  Pity it's
implemented on perl not PHP though...anyone know a PHP implementation?



I will need to generate a pivot table similar to that in Excel, in this
version I want to list a unique list of fields across the top and down the
side with totals - called cross-tabulations.

John


























































   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] % operator

2003-08-14 Thread Matthew Moldvan
There's probably a better way to do this, but to retrieve only the 0.8 from
24/5 try this:

($a/$b)-floor($a/$b)

Regards,
Matt.

-Original Message-
From: Alain Barthélemy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 5:05 AM
To: php-db
Subject: [PHP-DB] % operator


Hello,

If you have

$a = 24;
$b = 5;

and

$c = $a/$b;

=== $c = 4.8

To retrieve the .8 (reste in french) I saw instruction:

$a%$b

Where can I find a manual for this '%' operator? Of course I already looked
in
all the Php manuals (operators, etc ...).

Thanks,



-- 
Alain Barthélemy
[EMAIL PROTECTED]
http://bartydeux.be
Linux User #315631


-- 
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] Extracting result - unknown number of fields

2003-08-14 Thread Dillon, John
..but even if I can get the names and number of fields during 'run-time',
how do I make the following statement applicable to a variable number of
fields:

while(list($a,$b...)= mysql_fetch_array($result))

or is there another way to extract which would work?

John

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: 14 August 2003 16:29
To: Dillon, John; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Extracting result - unknown number of fields


From: Dillon, John [EMAIL PROTECTED]

 While doing a cross tabulation, I've got a query which gives me a variable
 number of fields:

Maybe mysql_num_fields() and mysql_field_name() will be of use, here? Check
the manual..

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Table Field type

2003-08-14 Thread CPT John W. Holmes
From: Michelle Whelan [EMAIL PROTECTED]
 Does anyone know what field type to use for inserting a webpage name into
a database?  Example pagename.html

 When I fill in the form information everything seems to insert fine, then
I do a search to see the result and nothing is there, so I check the entry
in the database and there is an empty space.  Please help.  Thanks.

A CHAR or VARCHAR field will be fine. The reason it's not showing up is
probably due to your code or PHP setup, rather than the database column
(unless you had something like INTEGER?? :)

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: Maximum execution time of 30 seconds exceeded

2003-08-14 Thread David Robley
In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 I am using the Konqueror browser and browing to http://localhost/my.php
 
 Howerver, the script I wrote, doing various queries and lookups, inserts, 
 etc..  takes a while to complete.   That is fine with me.  I'll wait.   
 However, the server and/or browser will not wait. 
 
 I believe the server is the one which will not wait because I have one echo 
 line at the beginning of the script which put a title Udate Students athe 
 the top center of the page and that writes then there is a pause while the 
 queries are run and then I get the following error in my browser
 
 Fatal error: Maximum execution time of 30 seconds exceeded in 
 /var/www/html/student_info/ps2follett.php on line 139
 
 
 Can anyone help?

http://www.php.net/set_time_limit

Cheers
-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: newbie lost on data import... part 2

2003-08-14 Thread jsWalter
This SQL is generated by my script...

   INSERT INTO cbs_eps ( eps_id , eps_name , eps_num , eps_air_date )
   VALUES ( '5','No Hiding Place','5','1974-01-10');

'eps_id' is generated from the index ($x) of the array loop

the others are retrieved from the tab delimted text file

When run from the script, the only thing going in is the epd_id! :(

All others are either ZERO or empty (defaults)

Now, if I take this same SQL and drop into phpmyAdmin all the data is
inserted!

All the fields!

What the h#@ and I doing wrong!  

The only thing Ican think of is varialbe typing.

Walter



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] % operator

2003-08-14 Thread Phil Driscoll
On Tuesday 12 August 2003 10:39 am, Phil Driscoll wrote:
 The modulus is the remainder after division hence 5 into 24 goes 3 times
 with a remainder of 4,

oops - 4 times with a remainder of 4 :(

-- 
Phil Driscoll


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] sybase time outs

2003-08-14 Thread Mills Staylor
Hi Guys.  Is it possible to specify a sybase timeout with the current stable
version of php?  I am using --with-sybase (dblib) compiled against sybase
OCS.

Thanks
Mills



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Breaking down a table field....

2003-08-14 Thread Tristan . Pretty
I have a table, wth many entries.
Each entry has been asigned a unit to belong to.

I want to list all the units dynamically.
How can I display all the units, without displaying each instance of the 
unit?

EG:

Unititem
breakfast   cereal
breakfast   toast
lunch   salad
lunch   sandwich
dinner  steak
dinner  pie
lunch   soup
dinner  lasagne

and so on..
I'd wanna get a list of:
breafast
lunch
dinner

not several instances of each...
how can I do this?

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



RE: [PHP-DB] determining if a query returns no value

2003-08-14 Thread Matt Schroebel
Wendall Williams wrote:
 If the client has no entries for that category, it
 needs to move on to the next category.

Yes, see mysql_num_row($result).  That function will return the number
of rows in the result set.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] full text search in mysql

2003-08-14 Thread Larry E . Ullman
I do get results for islands in greece as well. How can I specify in my
statement, that both words have to be present?
From the MySQL manual:
As of Version 4.0.1, MySQL can also perform boolean full-text searches 
using the IN BOOLEAN MODE modifier.

mysql SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+MySQL 
-YourSQL' IN BOOLEAN MODE);

Use + to indicate required words.

Larry

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] incrementor in loop is not incrementing.. any thoughts?

2003-08-14 Thread Aaron Wolski
Hi There,

Yeah.. it was a copy paste

Trying again:

$threadQuery = db_query(SELECT id,type,colourID FROM kcs_threads 
WHERE id=.escapeValue($typeResult[id]));
for ($i=0;$threadResult = db_fetch($threadQuery);$i++) {

echo $threadResult[colourID]. .$i;

}

Output:

223 0 
225 0 
301 0 
304 0 
326 0 
333 0 
211 0 
223 0 
224 0 
225 0 
356 0 
95 0 
100HL 0 
102 0


0 is equal to $i.. in other words - it is not incrementing.

Sorry for the bad copy/paste. Hope this one is better.

Aaron

-Original Message-
From: Matt Schroebel [mailto:[EMAIL PROTECTED] 
Sent: August 5, 2003 10:02 AM
To: Aaron Wolski
Subject: RE: [PHP-DB] incrementor in loop is not incrementing.. any
thoughts?

Is that a copy/paste?  You're showing newlines which I don't see in the
pasted code ...

 -Original Message-
 From: Aaron Wolski [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, August 05, 2003 9:58 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] incrementor in loop is not incrementing.. 
 any thoughts?
 
 
 I have this:
  
 $threadQuery = db_query(SELECT id,type,colourID FROM 
 kcs_threads WHERE
 id=.escapeValue($threadsResult[id]));
 for ($z=0;$threadResult = db_fetch($threadQuery);$z++) {
  
 echo $threadResult[colour]. .$z;
  
 }
  
 which is producing:
  
 
 223 0
 
 225 0
 
 301 0
 
 304 0
 
 326 0
 
 333 0
 
 211 0
 
 223 0
 
 224 0
 
 225 0
 
 356 0
 
 95 0
 
 100HL 0
 
 102 0
  
  
 Obviously $z is not incrementing. ANY clue why?
  
 Thanks!
  
 Aaron
  
 Aaron Wolski, Project Manager
 Martek Business Solutions Inc.
 www.martekbiz.com http://www.martekbiz.com/ 
 905-780-9574
 [EMAIL PROTECTED]
  
 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Configuring PHP with Firebird

2003-08-14 Thread Jason Wong
On Wednesday 06 August 2003 13:41, Evan Morris wrote:

 Basically, I want to know if it is possible to make PHP aware of
 Interbase/Firebird *without* recompiling PHP.

It depends on how you've installed PHP. If it was installed from a distro's 
RPM then maybe there's no need to recompile -- ask on your relevant distro's 
mailing list.

If using Windows then check out:

 http://www.ibphoenix.com/main.nfs?page=ibp_beginners_php

(which you could have found by googling for  firebird php)

 If it is not possible, I'd like to know what option to pass PHP at
 configure time when the Firebird installation is on a remote machine. Ie,
 the machine where PHP is running *does not* have Firebird installed.

As Firebird is based on Interbase, I believe you can use PHP's Interbase 
interface: manual  InterBase functions, for installation instructions.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
The best way to hold a man is in your arms
-- Murphy's Laws on Sex n18
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] full text search in mysql

2003-08-14 Thread Merlin
 As of Version 4.0.1, MySQL can also perform boolean full-text searches

I am running Mysql 3.x . This sounds like a simple task to me. Is it not
implemented in 3.x?

It does not have to be OR, NOR or anything, just AND

merlin



Larry E . Ullman [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
  I do get results for islands in greece as well. How can I specify in my
  statement, that both words have to be present?

  From the MySQL manual:
 As of Version 4.0.1, MySQL can also perform boolean full-text searches
 using the IN BOOLEAN MODE modifier.

 mysql SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('+MySQL
 -YourSQL' IN BOOLEAN MODE);

 Use + to indicate required words.

 Larry




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PHP MSSQL

2003-08-14 Thread Matthew McNicol

Shaun, the MySQL manual suggests that you have hit your limit using the
VARCHAR field type (255 characters). To store 6,000 characters have you not
considered using the TEXT field type?



6.2.3.1 The CHAR and VARCHAR Types
The CHAR and VARCHAR types are similar, but differ in the way they are
stored and retrieved.

The length of a CHAR column is fixed to the length that you declare when you
create the table. The length can be any value between 1 and 255. (As of
MySQL Version 3.23, the length of CHAR may be 0 to 255.) When CHAR values
are stored, they are right-padded with spaces to the specified length. When
CHAR values are retrieved, trailing spaces are removed.

Values in VARCHAR columns are variable-length strings. You can declare a
VARCHAR column to be any length between 1 and 255, just as for CHAR columns.
However, in contrast to CHAR, VARCHAR values are stored using only as many
characters as are needed, plus one byte to record the length. Values are not
padded; instead, trailing spaces are removed when values are stored. (This
space removal differs from the SQL-99 specification.) No case conversion
takes place during storage or retrieval.

If you assign a value to a CHAR or VARCHAR column that exceeds the column's
maximum length, the value is truncated to fit.



- Original Message -
From: Shaun Bentley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 11, 2003 11:23 AM
Subject: [PHP-DB] PHP  MSSQL


 Hi
 I am currently trying to use PHP and MSSQL together but I am having a
 few problems.

 I can enter data into the Db OK, but when pulling the data back to display
 on the page, the string cuts to around 250 chars. The Db field is VarChar
 6000 and I can see the whole data in the field.

 I have tried pulling the data out as object, array  row but always lose
the
 end.

 Any help please!

 Shaun



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.506 / Virus Database: 303 - Release Date: 01/08/2003


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: PHP MSSQL

2003-08-14 Thread jeffrey_n_Dyke

personally, i had luck with the statement below, but have sent it to others
in the past and they had varying results.  but give this a shot at the top
of your page that your PHP code is running on.


mssql_query(set textsize 65536);

hth
Jeff


   
 
  Adam Presley   
 
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
   
  m   cc: 
 
   Subject:  [PHP-DB] Re: PHP  MSSQL  
 
  08/11/2003 10:26 
 
  AM   
 
   
 
   
 




I know what you're going through here. In MS SQL you can define a VARCHAR
up
to about 8000 characters, but your PHP mssql_query command only returns 255
(0 - 254) characters. I then tried using the TEXT datatype. TEXT datatype
in
MS SQL allows somewhere around 2 billion characters. However, the PHP
mssql_query command only returns 4096 characters every time. This appear to
be a limitation of the PHP MSSQL commands.


Shaun Bentley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi
 I am currently trying to use PHP and MSSQL together but I am having a
 few problems.

 I can enter data into the Db OK, but when pulling the data back to
display
 on the page, the string cuts to around 250 chars. The Db field is VarChar
 6000 and I can see the whole data in the field.

 I have tried pulling the data out as object, array  row but always lose
the
 end.

 Any help please!

 Shaun





--
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] PHP and XML

2003-08-14 Thread Rick Dahl
What is the best way to parse through a non-repeting XML output using php?


- Rick

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Calculated field in MySQL

2003-08-14 Thread John W. Holmes
Morten Twellmann wrote:

Hello,

I got the following error message from MySQL:
---
Query failed.
MySQL said:

Unknown column 'AGE' in 'where clause'

query = SELECT *, (Year(Now()) - Year(BDAY)) +
((DAYOFYEAR(Now())-DAYOFYEAR(BDAY))/365) as AGE FROM Katalog WHERE AGE = 31
AND AGE = 50 AND IS_MEM_EXP = 0 AND IS_OPEN = 1 ORDER BY INPUT_DATE DESC
---
Now, obviously the column should exist, since I am creating it in the query,
but I do not seem to be able to find the bug.
If I would have used Access, I would have created a query inside the
database from my table and SELECT from that, but since I am not I have to
find other ways.
What I would like to do the most, would be to create a field in the table,
which would calculate the field inside the database, but it does not seem to
be possible, though it would save me a lot of trouble every time I need that
column in my application.
Could someone either tell me whats wrong with my query or tell me what I
need to do to make such a calculated field.
Use HAVING for Age, rather than WHERE

http://www.mysql.com/doc/en/SELECT.html
(search for HAVING)
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] ODBC Database

2003-08-14 Thread Gerard Samuel
Larry E.Ullman wrote:

Im looking at venturing into working with PHP's ODBC extention.
Does anyone have any recommendations as to a Database, that is easy to
understand/get into from a novice point of view, that installs on 
windows 2k,
and is free?


MySQL is kind of free, installs on W2K and is easy to use but it 
doesn't require PHP's ODBC extension since PHP already has a good 
MySQL extension. If you really want to use ODBC and you have MS 
Office, you could try Access. 
What Im doing is seeing if my code will run on different databases.
Of which it currently runs on mySQL, PostgreSQL and MSSQL.
As soon as I can get PHP5 installed Ill be checking out SQLLite.
But in the meantime, Im looking for a database that would interface with 
ODBC.
I just downloaded IBM's DB2 Personal Edition, to see what I can do 
there, but,
Im just looking for advice etc from others who went down this road.

Thanks

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] MySQL Returns Error

2003-08-14 Thread Matt Schroebel


 -Original Message-
 From: Jeff [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, August 05, 2003 3:15 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] MySQL Returns Error
 
 Every time I access or refresh the page, it adds one blank 
 entry to the DB.
 
 Maybe I have the insert query in the wrong place?

if ('POST' == $_SERVER['REQUEST_METHOD']) {
//someone submitted the form with method=post
// so validate input, and if okay store it in db
}

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Multiple checkboxes

2003-08-14 Thread Mike Baerwolf
Hello,

I'm trying to get the values from a form post with multiple checkboxes 
checked . Here is what I have,

if ($row = mysql_fetch_array($result));

do {
input type=checkbox name=class_id[] value=$row[class_id] $row[name]

 }while ($row = mysql_fetch_array($result));
and when submitted

if ($class_id) {
foreach($class_id as $varName)
print Variable: $varName\n;
}
All I get from this is Invalid argument supplied for foreach().  From 
what I could find doing a google search was to create an array using 
class_id[] and the above foreach().

Thanks in advance for any help!
Mike
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] problem with some functions MYSQL in LINUX

2003-08-14 Thread Nilashis




  
  

  
  
  HI 
  
  I'm having a problem using some php 
  functions in LINUX machines. I'm trying the "header" function to 
  redirect my visitiors to a specific page  i want to generate the 
  pages dynamically , using arguments (For ex. redir.php?img=1.jpg). It 
  is working fine in Windows machine , but not in LINUX/UNIX .It is 
  giving me error that headers are already sent .I don't know why it is 
  happening. I tried many things like (1) I checked the configuration 
  file (Php.ini) . some of the configurations r like that 
  :***
  arg_separator.input = 
  ""arg_separator.output = 
  ""output_buffering = 
  off(2) 
  i tried changing the code . As i was found that the argument isn't coming 
  from the previous page.The code i used there is 
  : 
  *** redir.php 
  *global 
  $link;if($link=="")die("error");
  header("Location: 
  $link");
  **
  now if a link is like that : 
  redir.php?link=http://www.yahoo.com , then it should redirect the 
  visitor to the YAHOO! , but it is working in Windows  not in 
  LINUX. In Windows , i saw this problem when the output_buffering is 
  set to off. So i turned it on ,  it is working fine in windows, 
  but in LINUX , the same problem persists. Using "ob_start() " 
  function , i tuned this function on (manually).I don't know how to 
  solve this problem. 
  I'm also unable to use MYSQL database 
  in LINUX . It is saying that the built in PHP functions for mysql 
  (like mysql_connect() etc.) are unknown functions. Can anybody please help 
  me ?
  
  please help me .
  
  Thanking u 
  
  NILASHIS
  
  http://www.geocities.com/cnilashis
  
  

  


  
  
   IncrediMail - Email has finally evolved - 
Click 
Here

RE: [PHP-DB] MySQL and PHP?

2003-08-14 Thread Natividad Castro
posgreSQL

-Original Message-
From: Richard [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 1:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL and PHP?


Hello

I hope this is a rumour but I heard that MySQL is now fully GPL which it
wasn't earlier.
I think the part used to communicate with the mysql server was lgpl. Does
this mean that
when using php with mysql your php scripts have to be licensed under the gpl
as well if
released?

If this is the case what other free sql databases are there that can be used
with php?

Thanks for reading.



--
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] [SPAM?] [PHP-DB] URGENT BUSINESS RELATIONSHIP

2003-08-14 Thread PRINCESS GRACE ABONIME
This mail is probably spam.  The original message has been attached
along with this report, so you can recognize or block similar unwanted
mail in future.  See http://spamassassin.org/tag/ for more details.

Content preview:  The Palace of King of Ogoni Kingdom, Ogoni Oil
  producing community, Rivers State Nigeria. Dear Sir, I am Princess
  Grace , daughter of HRH King Solomon Abonime, the king of Ogoni
  Kingdom. I am 25 years old and a graduate of Mass Communication. My
  father was the king of Ogoni Kingdom the highest oil producing area in
  Nigeria. He was in charge of reviving royalties from the multi-national
  oil companies and government on behalf of the oil producing communities
  in Nigeria. After the hanging of the Ogoni Nine(9) including Ken Saro
  Wiwa by the late dictator General Sani Abacha, my father suffered
  stroke and died in August27th last year. But before his death, he
  called me and told me he has Nine Million Five Houndread Thousand
  Dollars (USD9,500,000.00) cash in his possession, specially deposited
  in a Security vault company here. [...] 

Content analysis details:   (13.10 points, 5 required)
FROM_ENDS_IN_NUMS  (0.7 points)  From: ends in numbers
NIGERIAN_SUBJECT2  (2.3 points)  Subject is indicative of a Nigerian spam
RATWARE_OE_MALFORMED (2.9 points)  X-Mailer contains malformed Outlook Express version
DEAR_SOMETHING (2.6 points)  BODY: Contains 'Dear (something)'
US_DOLLARS (1.5 points)  BODY: Nigerian scam key phrase (million dollars)
URGENT_BIZ (0.2 points)  BODY: Contains urgent matter
US_DOLLARS_3   (0.9 points)  BODY: Nigerian scam key phrase ($NN,NNN,NNN.NN)
DATE_IN_FUTURE_03_06 (0.9 points)  Date: is 3 to 6 hours after Received: date
SUBJ_ALL_CAPS  (1.1 points)  Subject is all capitals


---BeginMessage---
The Palace of King of Ogoni Kingdom,
 Ogoni Oil producing community,
 Rivers State Nigeria.


   Dear Sir,

 I am Princess Grace , daughter of HRH King Solomon
 Abonime, the king of Ogoni Kingdom.  I am 25 years old
 and a graduate of Mass Communication.
 My father was the king of Ogoni Kingdom the highest
 oil producing area in Nigeria.  He was in charge of
 reviving royalties from the multi-national oil
 companies and government on behalf of the oil
 producing communities in Nigeria.  After the hanging of the
 Ogoni Nine(9) including Ken Saro Wiwa by the late
 dictator General Sani Abacha, my father suffered
 stroke and died in August27th last year.  But before
 his death, he called me and told me he has Nine Million
 Five Houndread Thousand Dollars
 (USD9,500,000.00) cash in his possession, specially
 deposited in a Security vault company here.

 He advised me not to tell anybody except my mother who
 is the last wife of the (8) eight wives that he
 married.  My mother did not bear any male child for
 him.  Which implies that all my father's properties,
 companies e.t.c., we have no share in them because my
 mother has no male child according to African
 Tradition.  My father therefore secretly gave me all
 the relevant documents of the said money, and told me
 that I should use this money with my mother and my
 younger sisters because he knows that tradtionally, if
 he dies we cannnot get anything, as inheritance.
 He importantly advised me that I should seek foreign
 assistannce and that I should not invest this money
 here in Nigeria because of his other wives and male
 children who happen to be my elders.  I am soliciting
 for your immediate assistance to get a Bungalow for
 us, where I will live with my mother and two younger
 sisters and further advise me where and how I will
 invest the balance money overseas, possibly on
 products of your company and other profitable
 ventures.

 I believe that by the special grace of God, you will
 help us move this money out of Nigeria to any country
 of your choice where we can invest this money
 judiciously with you.  You are entitled to a
 reasonable part of this money based on our agreement,
 and God will bless you as you help us.

 PLease i needed you to kindly send me your contact informations[your
office
 phone and fax number including your cell phone where i can reach you at
all
 time for further concrete dicussions regards to further development of
this
 transaction.

 Awaiting your response asap and God bless.

 Regards.

 Princess Grace Abonime



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


---End Message---
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Re: [PHP-DB] Breaking down a table field....

2003-08-14 Thread usban
SELECT Unit,COUNT(Unit) as quantity FROM TABLE GROUP BY Unit

-- Oscar Satorre Pérez   [EMAIL PROTECTED] -- 

- Mensaje Original - 
Remitente: [EMAIL PROTECTED] 
Destinatario: [EMAIL PROTECTED] 
Fecha: Jueves, Agosto 7, 2003 3:52pm 
Asunto: Re: [PHP-DB] Breaking down a table field 

Next question 
How can I show how many of each there were? 
SO now I have  
 
breafast 
lunch 
dinner 
 
I want to have 
 
breafast2 
lunch   3 
dinner  3 
 
etc... 
is that just as easy? 
 
 
 
 
 
 
 
[EMAIL PROTECTED] 
07/08/2003 14:42 
 
 
   To: [EMAIL PROTECTED] 
   cc: [EMAIL PROTECTED] 
   Subject:Re: [PHP-DB] Breaking down a table field 
 
 
 
SELECT DISTINCT(Unit) from TABLE_NAME; 
 
 
 
 
  
 [EMAIL PROTECTED] 
 sungard.com To: php- 
[EMAIL PROTECTED]  
 
 cc:  
 08/07/2003 09:37 AM Subject:  [PHP-DB]  
Breaking down a table field  
  
  
 
 
 
 
I have a table, wth many entries. 
Each entry has been asigned a unit to belong to. 
 
I want to list all the units dynamically. 
How can I display all the units, without displaying each instance of  
theunit? 
 
EG: 
 
Unititem 
breakfast   cereal 
breakfast   toast 
lunch   salad 
lunch   sandwich 
dinner  steak 
dinner  pie 
lunch   soup 
dinner  lasagne 
 
and so on.. 
I'd wanna get a list of: 
breafast 
lunch 
dinner 
 
not several instances of each... 
how can I do this? 
 
* 
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above. 
If the reader of this message is not the intended recipient or an 
agent 
responsible for delivering it to the intended recipient, you are 
hereby 
notified that you have received this document in error and that any 
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original  
message.***
 
 
 
 
 
 
 
 
--  
PHP Database Mailing List (http://www.php.net/) 
To unsubscribe, visit: http://www.php.net/unsub.php 
 
 
 
 
 
* 
The information contained in this e-mail message is intended only  
for  
the personal and confidential use of the recipient(s) named above.   
If the reader of this message is not the intended recipient or an 
agent 
responsible for delivering it to the intended recipient, you are  
hereby  
notified that you have received this document in error and that any 
review, dissemination, distribution, or copying of this message is  
strictly prohibited. If you have received this communication in  
error,  
please notify us immediately by e-mail, and delete the original  
message.***
 
 
/SPAN


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Maximum execution time of 30 seconds exceeded

2003-08-14 Thread Michael Cortes
This worked great.   I am keeping a table of available PINs for each of my 
groups of students.  I rewrote the code to get a random number from the 
table and if if it updates the student successfully, it deletes the number 
from the availables table.

Thanks a lot!

On Monday 11 August 2003 03:09 pm, Mike Brum wrote:
 Why is it important that you recycle old PINs? This is most likely eating
 up the most time in your script execution.

 My suggestion would be to either

 A) just keep creating a new one and ignore ones when a child leaves or

 B) create a 2nd, much smaller table available_pins and when a child
 leaves, insert their former PIN into this table. Then upon executing the
 new student script, you check the available_pin table for rows  0. If so,
 use the first one. If not, give them a new one.

 Good luck.

 -M

 -Original Message-
 From: Michael Cortes [mailto:[EMAIL PROTECTED]
 Sent: Monday, August 11, 2003 2:57 PM
 To: Ben Lake
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Maximum execution time of 30 seconds exceeded


 I do have an auto_increment for the record id.  But that is just a way for
 me
 to uniquely id the record.  Student numbers, barcodes, etc can change.

 The reason I am using the do/while loop is:   Every student is getting a
 4digit pin for library, cafeteria and network access.  It has to be unique
 and we have been assigning a different range of numbers per building/grade.

 There are various procedural reasons for this.  I have verified that I am
 identifying the new student correctly and going into the do/while loop with
 a
 variable that holds the correct starting number for the appropriate pin
 range.  It's then just a matter of trying consecutive numbers till I find
 an

 available pin.  The pin may be available because a student left the school
 or
 because it's next available at the end of the line.

 Anyway, I was not aware I could pick and choose my ranges in an
 AUTO_INCREMENT
 field.

 I appreciate any thoughts you may have.  Thanks.

 On Monday 11 August 2003 02:41 pm, you wrote:
  Why don't you use an AUTO_INCREMENT field in your table to define a
  unique number?
 
  Ben
 
  -Original Message-
  I had a do while loop such as
 
  do {
  mysql_query ($qupdate, $link);
  $rslterror=mysql_error($link);
  $number++
  } while ($rslterror!=null);
 
  Anyway, I fixed my dumb mistake.  If anyone would like to help me with
  a better one, maybe you can tell me if I am doing my do while
  correctly. It's only running through once, not getting a succesful
  insert  and dropping out.
 
  Thanks

-- 

Michael Cortes
Fort LeBoeuf School District
34 East Ninth Street
PO Box 810
Waterford PA 16441-0810
814.796.4795

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread John W. Holmes
Dillon, John wrote:

OK, please ignore, I believe I've found the answer in the manual notes:

$query=your SQL;
$result=mysql_query($query) or die(Query ($query) sucks!);
$fields=mysql_num_fields($result);
echo table\ntr;
for ($i=0; $i  mysql_num_fields($result); $i++) //Table Header
Calculate the value for mysql_num_fields() outside of your for() loop to 
improve effeciency.

$num_fields = mysql_num_fields($result);
for($i=0; $i  $num_fields; $i++) // Table Header
{ print th.mysql_field_name($result, $i)./th; }
echo /tr\n;
while ($row = mysql_fetch_row($result)) { //Table body
echo tr;
for ($f=0; $f  $fields; $f++) {
echo td$row[$f]/td; }
echo /tr\n;}
echo /table
http://www.php.net/manual/en/function.mysql-num-fields.php
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] adding integer to field in query

2003-08-14 Thread Matt Schroebel
Dillon, John mailto:[EMAIL PROTECTED]  wrote on Wednesday, August
13, 2003 10:24 AM:

 How do you add a number to a field within the query, ie
 without having to
 extract?  Eg
 
 $query=UPDATE Choice SET visits=(visits+1) WHERE ID='$thisID';
 
 is the above visits=(visits+1) legal, cos it doesn't work
 at the moment?
 

It's executing right?  Echo out your query statement and see what you're
asking for.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] DB2 and php serialized data

2003-08-14 Thread Gerard Samuel
Most likely its not a PHP issue, but looking to see if anyone has run 
into this.
I've inserted a serialized string, into a CLOB column.
Trying to retrieve the column returns no results.

If anyone has any DB2 experience, I'd be grateful if I can bounce a few 
questions to you
offlist.

Thanks for any advice/tips you may provide...

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Left Join with more than two tables......

2003-08-14 Thread Michael Cortes
Thanks.  I couldn't find the correct syntax in my resources.  I tried at one
point to use commas like:

select * from table1
left join table2,table3 on table1.id=table2.id,table1.id=table3.id

Thanks again for the correct syntax.

On Tuesday 12 August 2003 04:00 pm, Brent Baisley wrote:
 The left join works the same for two or more tables.
 select * from table1
 left join table2 on table1.id=table2.id
 left join table3 on table1.id=table3.id
 ...

 Just specify the table you want to join and what to use to join them.

 On Tuesday, August 12, 2003, at 03:16 PM, Michael Cortes wrote:
  I know that we can ..
 
  select last_name,first_name, table2.school from table1 left join
  table2 on
  school_id=bldg_id
 
  Listing all students and giving the school name for all students, if
  they have
  one.  If not, it lists the kid anyway and leaves that field blank.
 
  Anyhow, how about multiple tables?  I can't find it with google.
 
  I have :
  table1 with the students
  table2 with library PINs and an autoincrement id
  table3 with a lunch status and an autoincrement id
 
  I want to list all students (I will select just certain fields)  but
  if they
  have it, I want to list the PIN from table2 and the lunch status from
  table3.
 
  I can do it as a join but then anystudent who doesn't cross-reference
  gets
  left out.  I need to list all students.

--

Michael Cortes
Fort LeBoeuf School District
34 East Ninth Street
PO Box 810
Waterford PA 16441-0810
814.796.4795


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] file upload security issue

2003-08-14 Thread Chen, Mao
Hi everyone,

 

I try to learn file uploading in PHP.  I've successfully uploaded a file
onto my server.  I use move_uploaded_file(tmp_dir/tmp_filename,
destination_dir/filename) to move the temp file.   The thing is that I
have to do a chmod 777 destination_dir in order to move the file.  Is
this bad for security?

 

Thanks  a lot in advance.



Re: [PHP-DB] Re: PHP MSSQL

2003-08-14 Thread Robert Twitty
I believe this is only applicable to fields of type text.  It may have
no effect on varchar(255) fields.  The purpose of this statement is to
limit the amount of memory allocated by the driver for text data. If it is
not specified, the driver will try to allocate 2GB of memory.  The
extension sets this value to 4096 by default.

-- bob

On Mon, 11 Aug 2003 [EMAIL PROTECTED] wrote:


 personally, i had luck with the statement below, but have sent it to others
 in the past and they had varying results.  but give this a shot at the top
 of your page that your PHP code is running on.


 mssql_query(set textsize 65536);

 hth
 Jeff



   Adam Presley
   [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
   m   cc:
Subject:  [PHP-DB] Re: PHP  MSSQL
   08/11/2003 10:26
   AM






 I know what you're going through here. In MS SQL you can define a VARCHAR
 up
 to about 8000 characters, but your PHP mssql_query command only returns 255
 (0 - 254) characters. I then tried using the TEXT datatype. TEXT datatype
 in
 MS SQL allows somewhere around 2 billion characters. However, the PHP
 mssql_query command only returns 4096 characters every time. This appear to
 be a limitation of the PHP MSSQL commands.


 Shaun Bentley [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hi
  I am currently trying to use PHP and MSSQL together but I am having a
  few problems.
 
  I can enter data into the Db OK, but when pulling the data back to
 display
  on the page, the string cuts to around 250 chars. The Db field is VarChar
  6000 and I can see the whole data in the field.
 
  I have tried pulling the data out as object, array  row but always lose
 the
  end.
 
  Any help please!
 
  Shaun
 
 



 --
 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] full text search in mysql

2003-08-14 Thread Merlin
Hi fellowes,

I am working on a full text search in php and mysql. It workes pretty good,
with one exception.

If two words are entered, I do get results for each words in seperate as
well.

Examle:
carribean islands

I do get results for islands in greece as well. How can I specify in my
statement, that both words have to be present?

Thanx for any hint on that,

Merlin



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PHP/DB2

2003-08-14 Thread Gerard Samuel
I started playing with DB2 earlier this week.
And come to find out that it creates table names/columns in UPPER case.
Does anyone have any experience using DB2 in a cross platform manner,
with other dbs such as MySQL?
Just looking for ideas, as I've run out of them...
Thanks

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: newbie lost on data import... part 3

2003-08-14 Thread jsWalter
OK, now I am really sure it has to do with the vars I defined from my text
file...

Once I have the text file open, I'm looping through it...

 // pull RETURN off the end
 $trimmed = rtrim($lines[$x]);

 // Pull apart array element
 list($strDate,$strNum,$strName) = explode (\t, $trimmed);

 // Make the Dte a mySQL Date Object
 $objDate = new Date($strDate);

 // Spit it out to double check what I've got
 echo '' . $strDate . ' - ' . $strNum . ' - ' . $strName . ' p /';

 // populate the array
 $aryFieldsValues = array( 'eps_id' = $x,
 'eps_name' = $strName,
 'eps_num'  = $strNum,
 'eps_air_date' = $strDate);

 // do the query
 $objResult = $db-autoExecute('cbs_eps', $aryFieldsValues,
DB_AUTOQUERY_INSERT);


This will insert NOTHING but the 'eps_id' which comes from the loop index.

Now, I added this before the array population...

 $strDate = '2002-01-09';
 $strNum  = '102';
 $strName = 'myName';

THIS WORKED!

This data was INSERTed into the database!

OK, riddle me this Batman!

God, I'm so lost!

Any ideas?

Walter





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Maximum execution time of 30 seconds exceeded

2003-08-14 Thread Michael Cortes
I do have an auto_increment for the record id.  But that is just a way for me 
to uniquely id the record.  Student numbers, barcodes, etc can change.

The reason I am using the do/while loop is:   Every student is getting a 
4digit pin for library, cafeteria and network access.  It has to be unique 
and we have been assigning a different range of numbers per building/grade.  
There are various procedural reasons for this.  I have verified that I am 
identifying the new student correctly and going into the do/while loop with a 
variable that holds the correct starting number for the appropriate pin 
range.  It's then just a matter of trying consecutive numbers till I find an 
available pin.  The pin may be available because a student left the school or 
because it's next available at the end of the line.

Anyway, I was not aware I could pick and choose my ranges in an AUTO_INCREMENT 
field.

I appreciate any thoughts you may have.  Thanks.


On Monday 11 August 2003 02:41 pm, you wrote:
 Why don't you use an AUTO_INCREMENT field in your table to define a
 unique number?

 Ben

 -Original Message-
 I had a do while loop such as

 do {
   mysql_query ($qupdate, $link);
   $rslterror=mysql_error($link);
   $number++
 } while ($rslterror!=null);

 Anyway, I fixed my dumb mistake.  If anyone would like to help me with a
 better one, maybe you can tell me if I am doing my do while correctly.
 It's only running through once, not getting a succesful insert  and
 dropping out.

 Thanks


-- 

Michael Cortes
Fort LeBoeuf School District
34 East Ninth Street
PO Box 810
Waterford PA 16441-0810
814.796.4795

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Sorting issue

2003-08-14 Thread Fernando Soto






This would happens ifyou have defined the data type of the columns as char or varchar.


---Original Message---


From: Aaron Wolski
Date: Viernes, 08 de Agosto de 2003 08:51:04 a.m.
To: 'Jeff'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Sorting issue

Seeing code might help us.

Aaron

 -Original Message-
 From: Jeff [mailto:[EMAIL PROTECTED]]
 Sent: August 8, 2003 10:44 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Sorting issue

 Why would a mysql db think that 55 was greater than 14000.

 I have several headings that display sql data under them, when you
click
 on
 the heading, it sorts that section (descending/ascending), but it only
 seems
 to be looking at the first two numbers in the one heading. Is there
a
 command that forces it to look at the entire record before sorting it?

 Thanks
 Jeff



 --
 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


.







 IncrediMail - Email has finally evolved - Click Here

Re: [PHP-DB] Database Design Issue

2003-08-14 Thread Jason Lange




Yes, songs do span shows. However, the list of songs for each weeks
show starts out as a *.asc (same a *.txt) space-separated file. This
gets uploaded via a PHP file that formats each row and inserts it into
the database. That's why even though I know there will be duplication
it appears (to me at least) I'll just have to live with it. I have no
guarentee that the songs will appear in the *exact same way* every time
either (you really don't want to know why -- I'm getting a migrain just
thinking about it). I've attached an example of the incoming files I
have to deal with for your reference.

Also, I'm just designing the website I will have no part in the
everyday maintenance of the website -- except when the maintainer gets
stuck. :)

Jason

CPT John W. Holmes wrote:

  From: "Jason Lange" [EMAIL PROTECTED]

  
  
Here's my question. I'm creating a website for a weekly radio show. One
of the items I would like to store in the database is the list of songs
played in each show (there's normally between 20-25 songs per show), and
the songs will be displayed by show. Should I put all of the songs in a
single table with a field denoting what show they're from, or should I
create a separate table for each weeks show and just request that entire
table? I'm looking at this from both a long-term performance and
*maintenance* issue.

  
  
The first question is if songs can span multiple shows? If so, you need 3
tables. One to hold the songs, each song getting a unique id. One table to
hold the shows, each show getting a unique id, and finally a third table
that relates the two. You'd list the song_id and the show_id that it's used
in. Add in a row for each song used in each show.

If a song is not shared across shows, then you could go with two tables. A
show table where each show gets a unique id and a song table with a column
that has a show_id in it relating it to what show it's used in.

You'd be better off with the first method, though, because sooner or later
down the line there's going to be a song shared, I imagine. :)

---John Holmes...


  



FOREVER WE WILL SING MICHAEL W. SMITHWORSHIP *DVD*   
(REUNION   )
YOUR LOVE OH LORDTHIRD DAY   OFFERINGS: A WORSHIP ALBUM  
(ESSENTIAL )
ENOUGH   CHRIS TOMLINOUR LOVE IS LOUD
(SPARROW   )
LORD YOU'VE BEEN GOOD TO ME  GRAHAM KENDRICK WHAT GRACE  
(FURIOUS   )
LET THE RIVER FLOW   DARRELL EVANS   LET THE RIVER FLOW  
(INTEGRITY )
MY GOD REIGNSDARRELL EVANS   LET THE RIVER FLOW  
(INTEGRITY )
I LAY ME DOWNDARRELL EVANS   FREEDOM 
(VERTICAL  )
I AM IN LOVE WITH YOUDARRELL EVANS   FREEDOM 
(VERTICAL  )
BREATH OF GODCHRISTY NOCKELS GIRLS OF GRACE  
(WORD  )
SPOKEN FOR   MERCY MESPOKEN FOR  
(INOTOF)
PRAISES BE   LINCOLN BREWSTERAMAZED  
(VERTICAL  )
LORD OVER ALLSONIC FLOOD RESONATE
(INO   )
HUNGRY   KATHRYN SCOTT   HUNGRY  
(VINEYARD  )
BE GLORIFIED TIM HUGHES  ALL AROUND THE WORLD
(WORSHIP T )
LORD YOU HAVE MY HEART   DELIRIOUS   CUTTING EDGE
(SPARROW   )
TRADING MY SORROWS   DARRELL EVANS   FREEDOM 
(INTEGRITY )
FIELDS OF GRACE  DARRELL EVANS   ALL I WANT IS YOU   
(VERTICAL  )
ALL I WANT IS YOUDARRELL EVANS   ALL I WANT IS YOU   
(VERTICAL  )
WE WILL EMBRACE YOUR MOVEDARRELL EVANS   LET THE RIVER FLOW  
(INTEGRITY )
LORD REIGN IN ME VINEYARD U.K.   WINDS OF WORSHIP 12 
(VINEYARD  )
YOU SHINEBRIAN DOERKSEN  YOU SHINE   
(INTEGRITY )
GOD OF WONDERS   CAEDMON'S CALL  IN THE COMPANY OF ANGELS
(ESSENTIAL )

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] % operator

2003-08-14 Thread Andrew D. Luebke
The easiest way would probably be to use the fmod function.

http://us3.php.net/manual/en/function.fmod.php

Andrew.

At 11:43 AM 8/12/2003, Matthew Moldvan wrote:

There's probably a better way to do this, but to retrieve only the 0.8 from
24/5 try this:
($a/$b)-floor($a/$b)

Regards,
Matt.
-Original Message-
From: Alain Barthélemy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 5:05 AM
To: php-db
Subject: [PHP-DB] % operator
Hello,

If you have

$a = 24;
$b = 5;
and

$c = $a/$b;

=== $c = 4.8

To retrieve the .8 (reste in french) I saw instruction:

$a%$b

Where can I find a manual for this '%' operator? Of course I already looked
in
all the Php manuals (operators, etc ...).
Thanks,



--
Alain Barthélemy
[EMAIL PROTECTED]
http://bartydeux.be
Linux User #315631
--
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] Re: Don't know why query works this way

2003-08-14 Thread David Robley
In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 I have been writing my queries like this...
 
 $link = mysql_connect ($host, $username, $password);
 $query = insert into $table ('joe', 15);
 if ( mysql_db_query($dbname, $query, $link))  {   }
 
 But then I was reading that I should use mysl_query instead of mysql_db_query.  
 But I was having a problem with where do i put the $dbname.
 
 When I used:
 
 mysql_query ($dbname, $query, $link)
 
 I got an error message saying i had too many arguments.  So I changed it to:
 
 mysql_query ($query, $link)
 
 I then got an error message saying it didn't know what database I was 
 connected to.  I finally got around the problem by including the database 
 name in the query, like so:
 
 $query = insert into $dbname.$table ('joe', 15);
 
 I shouldn't have to say, but this is a simplified example.  I didn't want to 
 include all the fields, tables, values that the true example has.  The 
 question is, am I doing this right?  Do I have no choice but to retype the 
 $dbname all over the place if I want to use mysql_query?
 
 Thank in advance for any help.

Well, no. You need to do mysql_select_db to select a database up front and 
if you happen to need to change databases, use it again. So something like

$dbname = 'whatever';
$link = mysql_connect ($host, $username, $password);
mysql_select_db($dbname);
$query = insert into $table ('joe', 15);
if ( mysql_db_query($dbname, $query, $link)){   }

etc etc
-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Making PHP aware of Firebird 1.5

2003-08-14 Thread Philippe Makowski
I'm trying (Firebird 1.5 RC4 PHP 4.3.1 Mdk 9.1.)

Get the PHP source from http://www.php.net/downloads.php

untar it:
tar xvfz php-*.tar.gz

cd to the untared base dir:
cd php-4*

according to http://bugs.php.net/bug.php?id=23928
add #define ISC_FAR in php_interbase.h
export LIBS=-lstdc++ -lcrypt


compile it with ib support:
./configure --with-interbase=shared,/opt/interbase

make

And there I got an error :
ext/mysql/libmysql/my_lib.o(.text+0x3c4): In function `my_dir':
/tempo/php-4.3.1/ext/mysql/libmysql/my_lib.c:169: undefined reference to `errno'
ext/mysql/libmysql/my_lib.o(.text+0x5ab): In function `my_stat':
/tempo/php-4.3.1/ext/mysql/libmysql/my_lib.c:588: undefined reference to `errno'
ext/mysql/libmysql/my_malloc.o(.text+0xb7): In function `my_malloc':
/tempo/php-4.3.1/ext/mysql/libmysql/my_malloc.c:24: undefined reference to `errno'
ext/mysql/libmysql/my_realloc.o(.text+0xb0): In function `my_realloc':
/tempo/php-4.3.1/ext/mysql/libmysql/my_realloc.c:44: undefined reference to `errno'
ext/mysql/libmysql/my_delete.o(.text+0x71): In function `my_delete':
/tempo/php-4.3.1/ext/mysql/libmysql/my_delete.c:16: undefined reference to `errno'
ext/mysql/libmysql/my_tempnam.o(.text+0x78):/tempo/php-4.3.1/ext/mysql/libmysql/my_tempnam.c:108:
more undefined references to `errno' follow
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Erreur 1

Nota : I don't have mysql on my machine.

-- 
Philippe Makowski
Firebird serveur SQL open-source en français http://firebird-fr.eu.org
Ma clé PGP : http://makowski.eu.org/pgpkey.html




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Problems with input and modify data on a form.

2003-08-14 Thread José Luis Palacios Vergara


begin 666 formfill.zip
[EMAIL PROTECTED])`-*!R\H$P'/[EMAIL PROTECTED]0!```49F]R;69I;PO86-E'1A
MBYG:69S]W2SL$PT8^!E.,+ \/___R^7.SZ=;7A_K/SM_OQ7.]*;6YXNJG^
MQ:XIZM'R_Q?3#7Y=XTF]O]QC[M*\U*EVIEKI4J7Q1/!\+N9-(9_C$P,
M('B3Q96$091!AT0!V0G`^M#A0*7D,QY:O6K94;=BHQ'CI7L#%.RL=ETUN
M*$B:9*.B=H(Y56B?OR8\OT]#DH;%FNT,)YH45 )F/DH8E)+X KX7BT
M[(.I[EMAIL PROTECTED](\B8V\_AS\S(SC9PZ+505@3:.9B;W([EMAIL PROTECTED]
M(K.%XGP%3!.+T3B4R(6:)6P+UU: 2_TAKY5Q6M%3+;.:JMI$)AES_G
MS\G'Q)2)S/Y;AZ[8W-G?%.22L9?P3K(69]JDW#RH[:AZN6QRUWMJL?5
MM%O-7?]T1),^,E/^ D]GPFV3,[EMAIL PROTECTED](`0#6@OP,X)
M4AX!```U`0``$P```9OFUF:6QL+V)OG)ABYG:69S]W2SL$PT8^!E.,+ 
M\/___R^7.SZ=;7A_K/SM_OQ7.]*;6YXNJG^Q:XIZM'R_Q?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lange [EMAIL PROTECTED]

 Here's my question. I'm creating a website for a weekly radio show. One
 of the items I would like to store in the database is the list of songs
 played in each show (there's normally between 20-25 songs per show), and
 the songs will be displayed by show. Should I put all of the songs in a
 single table with a field denoting what show they're from, or should I
 create a separate table for each weeks show and just request that entire
 table? I'm looking at this from both a long-term performance and
 *maintenance* issue.

The first question is if songs can span multiple shows? If so, you need 3
tables. One to hold the songs, each song getting a unique id. One table to
hold the shows, each show getting a unique id, and finally a third table
that relates the two. You'd list the song_id and the show_id that it's used
in. Add in a row for each song used in each show.

If a song is not shared across shows, then you could go with two tables. A
show table where each show gets a unique id and a song table with a column
that has a show_id in it relating it to what show it's used in.

You'd be better off with the first method, though, because sooner or later
down the line there's going to be a song shared, I imagine. :)

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Help with formating text from PHP

2003-08-14 Thread Budelak
Yes. Itis with enter key. It will not be possible to pre-determine the 
length as this field is supposed to be a news field.

I'm lost as to how to go about this as the enter key does  not generate 
chr(13) when saving. I'm really lost.

Holmes directed me to http://us2.php.net/nl2br. I'm currently going thru 
it. It seems they all exepected an HTML input.

Bunmi

Andrew D. Luebke wrote:

Well, as one of the last posts said, if you are displaying in a web 
browser, via HTML, you need to insert br tags where you want the text 
to go to the next line.  HTML doesn't respond to /r/n pairs.  So if that 
is how the user types them in (with a enter key at the end of lines) you 
need to replace with br's if there are no EOL's in the original text 
you need to decide on some arbitrary length and insert br at that point.

Andrew

At 12:03 AM 8/10/2003, Budelak wrote:

The text are type into an input field by the user who is nonot a 
programmer at all. This inputt field updates the database that is 
later called up for display.
Bunmi

Andrew D. Luebke wrote:

How are the paragraph breaks represented in the original text?  You 
have have to detect the paragraph breaks and change to a /r/n.
Andrew.
At 11:40 PM 8/9/2003, Budelak wrote:

Hello,
Can someone help with this problem I've been trying to solve but 
don't how to.

I have a field of type longtext that contains text with paragraphs 
at the time of entry.

But when I display this text content, the paragraphs are not shown. 
Everything will just appear in one long text with no paragraph break.

Bunmi Akinmboni

--
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] Extracting result - unknown number of fields

2003-08-14 Thread Dillon, John
While doing a cross tabulation, I've got a query which gives me a variable
number of fields:

$query=SELECT Dept;
$count=count($piv_cos);
for($x=0;$x$count;$x++){
$query.=, SUM(IF(Co='$piv_cos[$x]',Exps175,0)) AS '$piv_cos[$x]';
}
$query.= FROM $tbl1 GROUP BY Dept;
$result=mysql_db_query($db, $query, $connection) or die (Query9
failed: $query);

...but how do I extract?

$piv_depts=array(); 
for($x=0;$x$count;$x++){${piv_.$x}=array();}
$piv_dept1=array();
$x=0;
while(list($a,$b)= mysql_fetch_array($result))   //I DON'T KNOW HOW
MANY TO list()
{
$piv_cos[$x]=$a;
for($y=0;$y$count;$y++){${piv_.$y}[$x]=$b;}
//...
//...
//$piv_dept1[$x]=$b;
$x++;
}

Is there an alternative approach?
Thanks,
John





































   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Don't know why query works this way

2003-08-14 Thread Michael Cortes
I have been writing my queries like this...

$link = mysql_connect ($host, $username, $password);
$query = insert into $table ('joe', 15);
if ( mysql_db_query($dbname, $query, $link)){   }

But then I was reading that I should use mysl_query instead of mysql_db_query.  
But I was having a problem with where do i put the $dbname.

When I used:

mysql_query ($dbname, $query, $link)

I got an error message saying i had too many arguments.  So I changed it to:

mysql_query ($query, $link)

I then got an error message saying it didn't know what database I was 
connected to.  I finally got around the problem by including the database 
name in the query, like so:

$query = insert into $dbname.$table ('joe', 15);

I shouldn't have to say, but this is a simplified example.  I didn't want to 
include all the fields, tables, values that the true example has.  The 
question is, am I doing this right?  Do I have no choice but to retype the 
$dbname all over the place if I want to use mysql_query?

Thank in advance for any help.


-- 

Michael Cortes
Fort LeBoeuf School District
34 East Ninth Street
PO Box 810
Waterford PA 16441-0810
814.796.4795

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] about resultset internal pointer

2003-08-14 Thread Peng Cheng
in php,mysql_seek can move the pointer, but you have no way to know where
the pointer locates currently.
i think some function should be added in the future version, like
mysql_getPointerPosition($rs) which returns a int as the position in
resultset. so it's would be easy to implements some pointer moving functions
like mysql_movenext(), mysql_moveprev,mysql_movefirst,mysql_movelast etc.




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Functions - scope of returned result

2003-08-14 Thread Dillon, John
One more bite on this code.  

function queries(){
//code..
$piv_result=mysql_db_query($db, $query, $connection) or die (Query9
failed: $query);
return $piv_result;
}

function print(){
global $piv_result;
$count_fields=mysql_num_fields($piv_result);  //ERROR: 
//code...
}

//MAIN 
queries();
print();

Should this work - $piv_result is being returned from one function and then
being used in another function.  Am I missing something?

John































   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Help with formating text from PHP

2003-08-14 Thread John W. Holmes
Budelak wrote:

Hello,
Can someone help with this problem I've been trying to solve but don't 
how to.

I have a field of type longtext that contains text with paragraphs at 
the time of entry.

But when I display this text content, the paragraphs are not shown. 
Everything will just appear in one long text with no paragraph break.
http://us2.php.net/nl2br

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Query Cache not Working? MySQL 4.0.14-standard

2003-08-14 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED]
 For some reason my MySQL doesn't seem to be caching queries!

And you expect PHP to solve this how? Do you want PHP to cache the queries?
You must say please...

You need to set the four variables mentioned at the following URL in your
my.cnf file.

http://www.mysql.com/doc/en/Query_Cache_Configuration.html

especially the last two that give the size limit for the cache and turn it
ON.

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Breaking down a table field....

2003-08-14 Thread Tristan . Pretty
My word, easy when you know how...!
Cheers mate!!!






[EMAIL PROTECTED]
07/08/2003 14:42

 
To: [EMAIL PROTECTED]
cc: [EMAIL PROTECTED]
Subject:Re: [PHP-DB] Breaking down a table field



SELECT DISTINCT(Unit) from TABLE_NAME;




  
  [EMAIL PROTECTED]
  sungard.com To: [EMAIL PROTECTED] 
 
  cc: 
  08/07/2003 09:37 AM Subject:  [PHP-DB] 
Breaking down a table field 
  
  




I have a table, wth many entries.
Each entry has been asigned a unit to belong to.

I want to list all the units dynamically.
How can I display all the units, without displaying each instance of the
unit?

EG:

Unititem
breakfast   cereal
breakfast   toast
lunch   salad
lunch   sandwich
dinner  steak
dinner  pie
lunch   soup
dinner  lasagne

and so on..
I'd wanna get a list of:
breafast
lunch
dinner

not several instances of each...
how can I do this?

*
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***







-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP-DB] Pulling an ID list from a DB, then filtering that list againstanother list of ID's

2003-08-14 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED]
 Got an interesting problem! I have a list of ID's, basically  things
 people have viewed on my website. When I pull the viewable items from my
 database, I need to be able to filter out all the ID's people have
 already viewed, so that they only get a list of things they have not
 viewed.

 I can think of a way to do this, but it is a nasty loop situation, that
 would probably not be good and tie up significant CPU time. Anyone have
 any suggestions on ways to filter view items from a fresh list that I am
 pulling from my Database?

So you have a thing_id and a user_id. How do you mark the user as having
viewed the thing?

I'm thinking a LEFT JOIN is in order here, but need some more info on your
table structure.

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] % operator

2003-08-14 Thread Doug Thompson
The % is called the Modulus operator.  It is very briefly explained in the PHP 
manual in table 11-2.

In your example, $mod = $a % $b  == $mod = 0.8

It is a very easy operator to use.

Doug


On Tue, 12 Aug 2003 11:04:39 +0200, Alain Barthélemy wrote:

Hello,

If you have

$a = 24;
$b = 5;

and

$c = $a/$b;

=== $c = 4.8

To retrieve the .8 (reste in french) I saw instruction:

$a%$b

Where can I find a manual for this '%' operator? Of course I already looked in
all the Php manuals (operators, etc ...).

Thanks,



-- 
Alain Barthélemy
[EMAIL PROTECTED]
http://bartydeux.be
Linux User #315631


-- 
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] Pulling an ID list from a DB, then filtering thatlist againstanother list of ID's

2003-08-14 Thread Matt Babineau
Here is what I have for a layout:

thing_id - it is a hash value (md5())

I have a user session variable that is an array thing_id's that were
viewed.

So each time the user click a like to view a thing_id, I note that in a
session variable, so when they go back to the home page, all the things
they have viewed are not shown, only the ones they have not viewed.

Thing_id
-
1 | hash_id_1
2 | hash_id_2
3 | hash_id_3
4 | hash_id_4

Viewed (Session Var)

1 | hash_id_2
2 | hash_id_4


So when the user hits the homepage, they should get a list of 2 hash
ID's hash_id_1 and hash_id_3. That is how I want this to work, I just
need a slick way to compare and filter the viewed hash_id's from the
complete list I am pulling form the DB.

Does that help?

Thanks,
Matt

On Thu, 2003-08-14 at 16:35, CPT John W. Holmes wrote:
 From: Matt Babineau [EMAIL PROTECTED]
  Got an interesting problem! I have a list of ID's, basically  things
  people have viewed on my website. When I pull the viewable items from my
  database, I need to be able to filter out all the ID's people have
  already viewed, so that they only get a list of things they have not
  viewed.
 
  I can think of a way to do this, but it is a nasty loop situation, that
  would probably not be good and tie up significant CPU time. Anyone have
  any suggestions on ways to filter view items from a fresh list that I am
  pulling from my Database?
 
 So you have a thing_id and a user_id. How do you mark the user as having
 viewed the thing?
 
 I'm thinking a LEFT JOIN is in order here, but need some more info on your
 table structure.
 
 ---John Holmes...
 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Sybase Query- Problems with Pound Sign

2003-08-14 Thread John W. Holmes
Jeremy Peterson wrote:

I am having a problem with a query that has a pound sign in it.  The 
results are quite puzzling, it seems like the page doesn't load if the 
query is present.  I have tested this on other tables without the pound 
sign and they work beautifully, seems like the pound sign is the 
troublemaker to me.
[snip]
$sql = select * from item where bib# = 300;
The # character is generally used to start comments, so everything after 
it is ignored in your query. I'm surprised you could even name a column 
like that...

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] MySQL Returns Error

2003-08-14 Thread Hutchins, Richard
So create a hidden input field on the page called cur_id and set its value
to the id of the record being displayed. If no record is currently being
displayed, set it to -1.

When you get ready to handle the form data, check the $_POST['cur_id']
variable. If it's set to -1, perform an INSERT. If it's set to anything
else, perform an UPDATE using the value of $_POST['cur_id'] in your WHERE
clause.

I'm sure there are other ways to handle this. This is how I have handled it
in the past though. 

 -Original Message-
 From: Jeff [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 05, 2003 3:52 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] MySQL Returns Error
 
 
 Oops, my mistake, it's not a blank entry  - it re enters the 
 last entry.
 
 I can hit F5 or click refresh 1000 times and it will enter 
 the last entry
 1000 times.
 
 
 Jeff [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I tried putting that in a few diffrent places, same result 
 - is there
  somewhere special I need to put that?
 
  Matt Schroebel [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
 
 
   -Original Message-
   From: Jeff [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, August 05, 2003 3:15 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP-DB] MySQL Returns Error
  
   Every time I access or refresh the page, it adds one blank
   entry to the DB.
  
   Maybe I have the insert query in the wrong place?
 
  if ('POST' == $_SERVER['REQUEST_METHOD']) {
  //someone submitted the form with method=post
  // so validate input, and if okay store it in db
  }
 
 
 
 
 
 -- 
 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] Extracting result - unknown number of fields

2003-08-14 Thread John W. Holmes
Dillon, John wrote:
..but even if I can get the names and number of fields during 'run-time',
how do I make the following statement applicable to a variable number of
fields:
while(list($a,$b...)= mysql_fetch_array($result))

or is there another way to extract which would work?
$num_fields = mysql_num_fields($result);
for($x=0;$x$num_fields;$x++)
{ $field[$x] = mysql_field_name($result,$x); }
Now $field is an array full of your column names. Adapt to your needs.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] newbie lost on data import...

2003-08-14 Thread jsWalter
I have a 1400 line text file. TAB delimited.

 1974-01-13 8 Cold Storage

3 fields. nothing large or complicated.

I massaged the data to be in this format thinking it would make the import
easier.

I can open the file and drop it into an array just fine.

I can EXPLODE each array item into it's base parts (date, num, name) just
fine.

list($strDate,$strNum,$strName) = explode (\t, $lines[$x]);


But now I run into problems.

The 'date' will not insert into the database.
The 'num' will insert into the database.
The 'name' will not insert into the database.

well, one out of three's not so bad.  :/

This is what I'm trying to do...

$aryFieldsValues = array( 'eps_id'   = $x,
  'eps_name' = $strName,
  'eps_num'  = $strNum,
  'eps_air_date' = $strDate);

$strTableName = 'cbs_eps';
$objResult = $db-autoExecute($strTableName, $aryFieldsValues,
DB_AUTOQUERY_INSERT);

I even did this...


  $strSql  = 'INSERT INTO `cbs_eps` ( `eps_id` , `eps_name` , `eps_num` ,
`eps_air_date` ) ';
  $strSql .= VALUES ( ;
  $strSql .=   ' . $x   . ', ;
  $strSql .=   ' . $strName . ', ;
  $strSql .=   ' . $strNum  . ', ;
  $strSql .=   ' . $strDate . ' );;

  $objResult = $db-query($strSql);

Same results.

Can anyone tell me what I am doing wrong?

Oh, I did add this...

   // Yank off the RETURN at the end
   $strName = rtrim($strName);

   // ESCAPE all the funny stuff!
   $strName = mysql_real_escape_string($strName);


It gives me...

 \0L\0o\0s\0t\0 \0D\0o\0g = was 'Lost Dog'

But it still will not insert into database.

:(

BTW: you might need to know this...

   Field Type Attributes   Null   Default
   ---
   eps_idtinyint(4)No  0
   cat_idtinyint(4)Yes NULL
   eps_name  varchar(100)  Yes NULL
   eps_num   int(11)   Yes NULL
   eps_air_date  date  Yes -00-00


AND, please, someone, tell me how to make this date string '1974-01-13' into
something that mySQL will accept.

Thanks for your help.

Walter




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Database Design Issue

2003-08-14 Thread Jason Lange
Hello Everyone,

Here's my question. I'm creating a website for a weekly radio show. One 
of the items I would like to store in the database is the list of songs 
played in each show (there's normally between 20-25 songs per show), and 
the songs will be displayed by show. Should I put all of the songs in a 
single table with a field denoting what show they're from, or should I 
create a separate table for each weeks show and just request that entire 
table? I'm looking at this from both a long-term performance and 
*maintenance* issue.

TIA,
Jason
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] mysql problem importing data

2003-08-14 Thread David Robley
In article [EMAIL PROTECTED], [EMAIL PROTECTED] 
says...
 Hello Mark,
 
 I have tryed it by splitting the file into pices and then insert it with the
 help of phpmyadmin. This woked.
 
 however, I do have some more files to upload, and this seems to be not the
 fastest way:-)
 
 I tryed this:
 mysql LOAD DATA  INFILE 'Hotel_Description.txt'INTO TABLE
 test.hotels_descriptionFIELDS  TERMINATED BY '\t' LINES TERMINATED BY
 '\n';
 ERROR 2013: Lost connection to MySQL server during query
 mysql 030806 02:08:37  mysqld ended
 
 As you can see, my db server creashed! Nothing special about this file.
 
 I am running MySQL 3.23.49 without problems so far.
 
 Merlin
 
 Mark [EMAIL PROTECTED] schrieb im Newsbeitrag
 news:[EMAIL PROTECTED]
  You could use mysqlimport with --fields-terminated-by=;
 
  or you could open it in something like Excel, parse it there (text to
  columns), and save it as a CSV
 
  or you could read it line by, line into PHP, explode each line on the
  ;, then insert the data into MySQL
 
  or you could write a YourFavLanguageHere script that does a string
  substitution of ; to ,
 
  Lots ofother options, too, which I haven't thought of.
 
  --- Merlin [EMAIL PROTECTED] wrote:
   Hi there,
  
   I have a data file with data seperated by semicolons. It is about
   8MB big.
   Now I just want to import it into mysql.
   I tryed several things. First I took phpmyadmin, which resulted in
   a white
   page without error msg. Then I tryed it by hand with load data.
   This did not
   work as well. No I installed myodbc and tryed to export it from MS
   Access.
   This completly crashes my database server with this message:
  
/usr/local/mysql/bin/safe_mysqld: line 1:  1067 Segmentation fault
   nice --5 nohup
   /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql
   --datadir=/home/m
   ysqladm/data --user=mysql --pid-file=/home/mysqladm/var/mysqld.pid
   --skip-lo
   cking -u mysqladm /home/mysqladm/data/SARATOGA.err 21
   030807 00:00:45  mysqld ended
  
   Has anybody an idea on how to import that data? Its nicely
   seperated by ;
  
   Thanx for any help,
  
   Merlin

I assume here that when you say the data is separated by semicolons, you 
mean that the fields are separated by semicolons. In that case you should 
be able to use LOAD DATA INFILE and tell it that the fields are terminated 
by semicolons, not tabs as in the example you show above.

-- 
Quod subigo farinam

$email =~ s/oz$/au/o;
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] DB2 and php serialized data

2003-08-14 Thread Gerard Samuel
Gerard Samuel wrote:

Most likely its not a PHP issue, but looking to see if anyone has run 
into this.
I've inserted a serialized string, into a CLOB column.
Trying to retrieve the column returns no results.

If anyone has any DB2 experience, I'd be grateful if I can bounce a 
few questions to you
offlist.

Thanks for any advice/tips you may provide... 
I did a few more tests last night, and the problem isn't with serialized 
data.
Im currently testing to see if a result contains returned data by 
issuing odbc_num_rows()
The wierd thing is that if I try to select a CLOB column (this is what 
Im using at the moment, but I believe it applies to all LOBs),
odbc_num_rows() would return -1
If I do not select a  CLOB (ie INTEGER, VARCHAR this is what Im 
currently testing with) column, odbc_num_rows() would return the
correct number of rows.
I've read about odbc_num_rows() returning -1 for some databases, but 
that statement alludes me to believe that it either works,
or doesn't work for a database.  Not whether it will work for some sql 
conditions.
So Im not sure if this is a bug or not.
Im currently testing with PHP 4.3.3R2, IBM DB2 8.1 Personal Edition on 
win2k/IIS 5
If what Ive noticed is the expected behaviour, please let me know so 
I'll know whether or not
to fill out a bug report...
If anyone wants more information, please let me know...

Thanks

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySQL Returns Error

2003-08-14 Thread jeffrey_n_Dyke

if i understand your question. why not take a different approach.  when the
form is submitted do your updates/inserts and then forward the page with
the header() function to another page, even if it is the same page, but
with a different set of variables set on the page, the idea being to remove
the $_POST/$_GET arrays containing your data

so at the end of your insert
header(Location: .$_SERVER['PHP_SELF'].?inserted=true);

you can send them from whence they came with
header(Location: .$_SERVER['HTTP_REFERER']);

hth
jd




   

  Jeff   

  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
  
  cc: 

   Subject:  Re: [PHP-DB] MySQL Returns 
Error  
  08/05/2003 06:41 

  PM   

   

   





I'm unsure of both suggestions, can someone go into more detail?


Richard Hutchins [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 So create a hidden input field on the page called cur_id and set its
value
 to the id of the record being displayed. If no record is currently being
 displayed, set it to -1.

 When you get ready to handle the form data, check the $_POST['cur_id']
 variable. If it's set to -1, perform an INSERT. If it's set to anything
 else, perform an UPDATE using the value of $_POST['cur_id'] in your WHERE
 clause.

 I'm sure there are other ways to handle this. This is how I have handled
it
 in the past though.

  -Original Message-
  From: Jeff [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, August 05, 2003 3:52 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] MySQL Returns Error
 
 
  Oops, my mistake, it's not a blank entry  - it re enters the
  last entry.
 
  I can hit F5 or click refresh 1000 times and it will enter
  the last entry
  1000 times.
 
 
  Jeff [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   I tried putting that in a few diffrent places, same result
  - is there
   somewhere special I need to put that?
  
   Matt Schroebel [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
  
  
-Original Message-
From: Jeff [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 3:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Returns Error
   
Every time I access or refresh the page, it adds one blank
entry to the DB.
   
Maybe I have the insert query in the wrong place?
  
   if ('POST' == $_SERVER['REQUEST_METHOD']) {
   //someone submitted the form with method=post
   // so validate input, and if okay store it in db
   }
  
  
 
 
 
  --
  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



RE: [PHP-DB] Maximum execution time of 30 seconds exceeded

2003-08-14 Thread Ford, Mike [LSS]
On 11 August 2003 07:02, Michael Cortes wrote:

 I am using the Konqueror browser and browing to
 http://localhost/my.php
 
 Howerver, the script I wrote, doing various queries and lookups,
 inserts, etc..  takes a while to complete.   That is fine with
 me.  I'll wait. However, the server and/or browser will not wait.
 
 I believe the server is the one which will not wait because I have
 one echo line at the beginning of the script which put a title
 Udate Students athe the top center of the page and that writes then
 there is a pause while the queries are run and then I get the
 following error in my browser 
 
 Fatal error: Maximum execution time of 30 seconds exceeded in
 /var/www/html/student_info/ps2follett.php on line 139

That's your PHP script timing out.  Take a look at
http://www.php.net/set_time_limit

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



Re: [PHP-DB] Help needed with variable scoping? or mysql problem

2003-08-14 Thread jeffrey_n_Dyke

best way to tell is to place .'or die(mysql_error())' after any call to
mysql_query() to see what mysql is complaining about.  personally I
sometimes declare the query first so i can echo that as well after the
msyql_error() function, so i can see the query that has just been
excecuted.  helpful with dynamic queries.

$qry = SELECT * FROM $tableName where $fieldName='$fieldValue';
$result = mysql_query($qry, $conn) or die(mysql_error() . $qry);

hth
jeff


   
 
  Mike Klein 
 
  [EMAIL PROTECTED]To:   [EMAIL PROTECTED]
   
  rg  cc: 
 
   Subject:  [PHP-DB] Help needed with 
variable scoping? or mysql problem   
  08/14/2003 08:58 
 
  AM   
 
   
 
   
 




I've been using JSP for some time now, and thought I'd write a couple of
rdbms explorers (flat tables, simple master/detail paradigm) using other
technologies, like PHP, Cocoon, etc. Well...it's been fun. I have more
working than not. But now I am hung up. I am getting wierd results in a php
script when I simply change the order of some mysql calls.

I'm using php-4.3.2, rh9, and mysql 3.23.

My error is the following (the first line above the Warning below is a dump
of parameters to the showMaster function which is what's bombing):

conn=Resource id #3 databaseName=info tableName=movies fieldName=title
fieldValue=36th Chamber
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /foo/bar/mywebsite/private/database.php on line 107

Line 107 is the first mysql_num_rows call below.

function showMaster($conn, $databaseName, $tableName, $fieldName,
$fieldValue)
{
echo conn=$conn\n;
echo databaseName=$databaseName\n;
echo tableName=$tableName\n;
echo fieldName=$fieldName\n;
echo fieldValue=$fieldValue\n;

This code fails when placed here==
$result = mysql_query(SELECT * FROM $tableName where
$fieldName='$fieldValue', $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo numRows=$numRows\n;


$fields = mysql_list_fields($databaseName, $tableName, $conn);
$numFields = mysql_num_fields($fields);
echo TABLE border=1 width=100%\n;
echo tr;
for($i = 0; $i  $numFields; $i++)
{
printf(td%s/td, mysql_field_name($fields, $i));
}
echo /tr;

The SAME code succeeds when placed here!==
$result = mysql_query(SELECT * FROM $tableName where
$fieldName='$fieldValue', $conn);
$numRows = mysql_num_rows($result);
if(mysql_num_rows($result) == 1)
{
showDetail($conn, $databaseName, $tableName, $fieldName,
$fieldValue, $result);
exit;
}
echo numRows=$numRows\n;


while($myrow = mysql_fetch_array($result))
...rest of method...
}

Any ideas on why this is? When I move the lines above (from
$result=...to...echo 'numRows') down a few lines to just before the
mysql_fetch_array, then everything works. Whazzup?!?


mike klein



--
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



  1   2   >