[PHP-DB] Re: E-mail as HTML

2004-08-26 Thread Nadim Attari
 In PHP, how do I submit data by e-mail as HTML to a specified address? And
where can I find samples of that in http://www.php.net/ ?

HTML Mime mail at phpGuru
http://www.phpguru.org/static/mime.mail.html

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



[PHP-DB] odbc_num_rows fails when HAVE_SQL_EXTENDED_FETCH is commented out

2004-08-26 Thread Mahmut Eren
Hi,
I'm using php-4.3.3 on mandrake Linux. I had a performance problem accessing to DB2 
databases on As400 systems. When I searched the internet I found out that commenting 
out '#define HAVE_SQL_EXTENDED_FETCH 1' lines from php_odbc_includes.h file could 
solve the problem. I edited the file and recompiled php; the result was a much better 
performance. But this time odbc_num_rows() statement fails and always returns -1. How 
can I solve this problem? Any suggestions?
Thanks in advance
Mahmut Eren

==-
Bu e-posta sadece yukarida isimleri belirtilen kisiler arasinda zel haberlesme 
amacini tasimaktadir. Size yanlislikla ulasmissa ltfen gnderen kisiyi 
bilgilendiriniz ve mesaji sisteminizden siliniz. Turkiye Cumhuriyet Merkez Bankasi 
A.S. bu mesajin icerigi ile ilgili olarak hicbir hukuksal sorumlulugu kabul etmez. 

This e-mail communication is intended for the private use of the people named above. 
If you received this message in error, please immediately notify the sender and delete 
it from your system. The Central Bank of The Republic of Turkey does not accept legal 
responsibility for the contents of this message.

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



Re: [PHP-DB] odbc_num_rows fails when HAVE_SQL_EXTENDED_FETCH is commented out

2004-08-26 Thread Robert Twitty
If HAVE_SQL_EXTENDED_FETCH is defined, then the odbc ext will use the
ODBC API function SQLExtendedFetch instead of SQLFetch to retrieve
records. SQLExtendedFetch is only necessary if a forward-only cursor is
not being used.  In the case of the odbc ext, it uses a dynamic cursor if
HAVE_SQL_EXTENDED_FETCH is defined.  The problem is that dynamic cursors
have the worst performance, while forward-only cursors have the best
performance.  However, forward-only cursors do not allow you to
predetermine the number of rows. This is why you are getting -1 from
odbc_num_rows().  A static cursor should have been used instead of a
dynamic cursor.  While it is not faster than forward-only, it is faster
than dynamic, and still allows you to get a row count.

-- bob

On Thu, 26 Aug 2004, Mahmut Eren wrote:

 Hi,
 I'm using php-4.3.3 on mandrake Linux. I had a performance problem accessing to DB2 
 databases on As400 systems. When I searched the internet I found out that commenting 
 out '#define HAVE_SQL_EXTENDED_FETCH 1' lines from php_odbc_includes.h file could 
 solve the problem. I edited the file and recompiled php; the result was a much 
 better performance. But this time odbc_num_rows() statement fails and always returns 
 -1. How can I solve this problem? Any suggestions?
 Thanks in advance
 Mahmut Eren

 ==-
 Bu e-posta sadece yukarida isimleri belirtilen kisiler arasinda özel haberlesme 
 amacini tasimaktadir. Size yanlislikla ulasmissa lütfen gönderen kisiyi 
 bilgilendiriniz ve mesaji sisteminizden siliniz. Turkiye Cumhuriyet Merkez Bankasi 
 A.S. bu mesajin icerigi ile ilgili olarak hicbir hukuksal sorumlulugu kabul etmez.

 This e-mail communication is intended for the private use of the people named above. 
 If you received this message in error, please immediately notify the sender and 
 delete it from your system. The Central Bank of The Republic of Turkey does not 
 accept legal responsibility for the contents of this message.

 --
 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] Update multiple tables

2004-08-26 Thread John Holmes
From: Khalid Judeh [EMAIL PROTECTED]
I have a script that make changes to the database in more than
one sql statement, as i need to update more than one table at
the same time, I want to know if there is a method where all
of those changes are committed, or rolled back if some error
occured(lets say in the last sql statement).
When asking questions like this, it's a smart idea to actually mention what 
database you're using.

Either way, you need to use transactions. Either use a database that 
supports them (most of them do, to varying degrees of complexity) or use a 
database abstraction layer that simulates them. ADOdb comes to mind, 
although I've never used that feature. http://adodb.sourceforge.net

---John Holmes... 

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


[PHP-DB] Space requirements (with respect to foriegn languages)

2004-08-26 Thread Gerard Samuel
My site/code/database is developed primarily for the english language.
I've had people from The Far East add content to my site using their
native language, and it is displaying properly in the site.
But Im a bit concerned about the number of characters these languages use.
For example, I've had someone enter -
chinese testing
It is saved in the database as -
chinese testing#12288;#20013;#25991;
Now, forgive my ignorance, but I have no idea what the additional
chinese characters mean, but from the values in the database, Im
assuming that it amounts to 3 characters.
But if Im correct that those are 3 characters, it is
using up 24 characters in a column.
My concern is that what if I were to limit a column to say 25 english
characters, and a chinese fellow, comes by and hypothetically says
Hello World in chinese and goes over the limit of the column, the data
will be truncated.
Is there anything that can be done to overcome this shortcoming?
Im currently using PostgreSQL 7.4.2, using SQL_ASCII as the database
characterset, FreeBSD 4.10, php 4.3.6.
Thanks for any advise you can provide...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Space requirements (with respect to foriegn languages)

2004-08-26 Thread Jonathan Haddad
(BOn Aug 26, 2004, at 12:27 PM, Gerard Samuel wrote:
(B
(B My site/code/database is developed primarily for the english language.
(B I've had people from "The Far East" add content to my site using their
(B native language, and it is displaying properly in the site.
(B But Im a bit concerned about the number of characters these languages 
(B use.
(B For example, I've had someone enter -
(B chinese testing$B!!CfJ8(B
(B
(B It is saved in the database as -
(B chinese testing#12288;#20013;#25991;
(B
(B Now, forgive my ignorance, but I have no idea what the additional
(B chinese characters mean, but from the values in the database, Im
(B assuming that it amounts to 3 characters.
(B But if Im correct that those are 3 characters, it is
(B using up 24 characters in a column.
(B
(B My concern is that what if I were to limit a column to say 25 "english"
(B characters, and a chinese fellow, comes by and hypothetically says
(B "Hello World" in chinese and goes over the limit of the column, the 
(B data
(B will be truncated.
(B
(B Is there anything that can be done to overcome this shortcoming?
(B
(B Im currently using PostgreSQL 7.4.2, using SQL_ASCII as the database
(B characterset, FreeBSD 4.10, php 4.3.6.
(B
(B Thanks for any advise you can provide...
(B
(B
(B
(Bwhy not just use a longer column?  (text instead of varchar)

[PHP-DB] Re: PHP Array to Javascript?

2004-08-26 Thread Jasper Howard
depending on the size I guess you could run a foreach loop
ex.

$num = 0;
foreach ($ringb as $val) {
 print x[$num] = '$val';\n;
 $num += 1;
}

so it pretty much just cycles through your array and prints it out in
javascript form...

Chris Payne [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi there everyone,



 I set an array using the following in PHP:



 $ringb[$i]=$complex_area;

 $i++;



 It cycles through my DB and stores the info, my question is, how can I
 convert it to a value that can be read in Javascript?



 I'm stumped.



 Chris



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



Re: [PHP-DB] Text area

2004-08-26 Thread Peter Ellis
I suspect your return result looks something like

input type=textarea rows=

rather than the full string, as you were expecting.  You do need to
escape quotes, as they are special characters.  Try:

function write_textarea()
 {
  return input type=textarea rows=\5\ cols=\70\ name=\\;
 }

I'm aware of the other replies to this message, but I'm being literal
and assuming you want that exact string returned, regardless of other
alternatives.  HTH.
-- 
Peter Ellis - [EMAIL PROTECTED]
Web Design and Development Consultant
naturalaxis | http://www.naturalaxis.com/

On Tue, 2004-08-24 at 16:43 +0800, Hafidz Abdullah wrote:
 Hi again, everyone.
 
 I also have a problem creating my text area.  I meant to do a text area (measuring 5 
 rows by 70 columns) which accompanies the words: First 50 words are free. 
 Subsequent 50 words or part thereof, $50 will be charged:
 
 function write_textarea()
  {
   return input type=textarea rows=5 cols=70 name=;
  }
  
 Doesn't work. How can I make it work?
 
 Thanks  regards,
 Hafidz

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



[PHP-DB] Array

2004-08-26 Thread 'Miguel Guirao'
Hi!!

I have a table with many options from when the user can select them,
after that, his/her selections will be stored in a database.

In the mean time, I want to store his/her selections in an array like
this one:

PN  DescQty
|---|--|---|
|---|--|---|
|---|--|---|

How do I declare Duch an array like this??, let's call it Parts.


Miguel Guirao
Servicios Datacard
www.SIASA.com.mx

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



[PHP-DB] Re: Array

2004-08-26 Thread Torsten Roehr
Miguel Guirao [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi!!

 I have a table with many options from when the user can select them,
 after that, his/her selections will be stored in a database.

 In the mean time, I want to store his/her selections in an array like
 this one:

 PN Desc Qty
 |---|--|---|
 |---|--|---|
 |---|--|---|

 How do I declare Duch an array like this??, let's call it Parts.


 Miguel Guirao
 Servicios Datacard
 www.SIASA.com.mx

Hi,

do you mean this:

$parts = array(array('PN' = $PN_value1, 'Desc' = $Desc_value1, 'Qty' =
$Qty_value1),
   array('PN' = $PN_value2, 'Desc' = $Desc_value2, 'Qty' =
$Qty_value2),
   array('PN' = $PN_value3, 'Desc' = $Desc_value3, 'Qty' =
$Qty_value3)
  );

Regards, Torsten Roehr

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



[PHP-DB] Updating a table when using LEFT JOIN

2004-08-26 Thread Chris Payne
Hi there everyone,

 

I am using the following to grab the data I need from several tables:

 

$sql = SELECT * FROM vendorprices LEFT JOIN fooditems on
(vendorprices.FoodItemNumber = fooditems.FoodItemID) WHERE
vendorprices.VendorNumber='$VendorID' ORDER BY
vendorprices.VendorItemNumber;

 

This works great, very fast etc .. the problem is, I then need to give the
option for them to edit the items - again, not a problem in populating the
form - until I have to then use the UPDATE function, how can I update each
item in separate tables when I use the above join to grab the info in the
first place?  I've never had to write to 2 tables at once where data is
relative like this, infact it was my first time of using JOINS at all to
even display the data.

 

I'm using PHP with MySQL.

 

Thank you.

 

Chris



Re: [PHP-DB] Array

2004-08-26 Thread Justin Patrin
$arr = array('key' = array('key2' = 'value', 'key3' = 'value', ...),
...);

$arr['key2'] = array('key2' = 'value', ...);

$arr['key3]['key2'] = 'value';

On Thu, 26 Aug 2004 16:11:27 -0500, Miguel Guirao [EMAIL PROTECTED] wrote:
 Hi!!
 
 I have a table with many options from when the user can select them,
 after that, his/her selections will be stored in a database.
 
 In the mean time, I want to store his/her selections in an array like
 this one:
 
 PN  DescQty
 |---|--|---|
 |---|--|---|
 |---|--|---|
 
 How do I declare Duch an array like this??, let's call it Parts.
 
 Miguel Guirao
 Servicios Datacard
 www.SIASA.com.mx
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 !DSPAM:412dfd2d29942082615647!
 
 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



[PHP-DB] select query across multiple tables

2004-08-26 Thread Cole S. Ashcraft
I'm trying to pull all the records from the table class where classID is 
not equal to the value of classID in the table assignment.

Currently, I have 'select class.classID, class.classDesc from class, 
assignment where assignment.classID = class.classID and 
assignment.assignmentID=$assidn'. $assidn is value of 
assignment.assignmentID.

When I do this query, I am missing a good chunk of records. What am I 
doing wrong?

Cole
--
This message has been scanned for viruses and
dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed
to be clean.
Please report any deviance from this condition immediately to the AFN
Administrator at [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Array

2004-08-26 Thread Micah Stevens
Since you provided no value's it's a little tough, but the general for would 
be:

$parts = array(
  array(PN = $row1col1, Desc = $row1col2, Qty = $row1col3),
  array(PN = $row2col1, Desc = $row2col2, Qty = $row2col3)
 );

Depending on your implimentation, it maybe easier to use some sort of loop to 
assign things. If you wanted the array to be persistant across pages, you'd 
want to user instead of $parts, $_SESSION['parts']. (assuming of course you 
have initialized a session)

I personally would skip the array stuff and just pop it in a database. 
-Micah 

On Thursday 26 August 2004 02:11 pm, 'Miguel Guirao' wrote:
 Hi!!

 I have a table with many options from when the user can select them,
 after that, his/her selections will be stored in a database.

 In the mean time, I want to store his/her selections in an array like
 this one:

 PNDescQty

 |---|--|---|
 |---|--|---|
 |---|--|---|

 How do I declare Duch an array like this??, let's call it Parts.


 Miguel Guirao
 Servicios Datacard
 www.SIASA.com.mx

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



Re: [PHP-DB] select query across multiple tables

2004-08-26 Thread jeffrey_n_Dyke


 I'm trying to pull all the records from the table class where classID is
 not equal to the value of classID in the table assignment.

 Currently, I have 'select class.classID, class.classDesc from class,
 assignment where assignment.classID = class.classID and
 assignment.assignmentID=$assidn'. $assidn is value of
 assignment.assignmentID.

 When I do this query, I am missing a good chunk of records. What am I
 doing wrong?

You're only getting the rows that are less then or equal to class.classID,
i think you want  or not equal to.
HTH
Jeff

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



Re: [PHP-DB] select query across multiple tables

2004-08-26 Thread Cole S. Ashcraft
Thanks!

It works

Cole

On Thu, 2004-08-26 at 16:45, [EMAIL PROTECTED] wrote:
  I'm trying to pull all the records from the table class where classID is
  not equal to the value of classID in the table assignment.
 
  Currently, I have 'select class.classID, class.classDesc from class,
  assignment where assignment.classID = class.classID and
  assignment.assignmentID=$assidn'. $assidn is value of
  assignment.assignmentID.
 
  When I do this query, I am missing a good chunk of records. What am I
  doing wrong?
 
 You're only getting the rows that are less then or equal to class.classID,
 i think you want  or not equal to.
 HTH
 Jeff
 
 
 
 
 
 
 
 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner on mail.ashcraftfamily.net, and is believed
to be clean.
Please report any deviance from this condition immediately to the AFN
Administrator at [EMAIL PROTECTED]

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



Re: [PHP-DB] Updating a table when using LEFT JOIN

2004-08-26 Thread Micah Stevens
From the Mysql docs: 

Starting with MySQL 4.0.4, you can also perform UPDATE operations that cover 
multiple tables: 

UPDATE items,month SET items.price=month.price
WHERE items.id=month.id;


 The example shows an inner join using the comma operator, but multiple-table 
UPDATE statements can use any type of join allowed in SELECT statements, such 
as LEFT JOIN. 


Note: You cannot use ORDER BY or LIMIT with multiple-table UPDATE. 


-Micah 


On Thursday 26 August 2004 03:23 pm, Chris Payne wrote:
 Hi there everyone,



 I am using the following to grab the data I need from several tables:



 $sql = SELECT * FROM vendorprices LEFT JOIN fooditems on
 (vendorprices.FoodItemNumber = fooditems.FoodItemID) WHERE
 vendorprices.VendorNumber='$VendorID' ORDER BY
 vendorprices.VendorItemNumber;



 This works great, very fast etc .. the problem is, I then need to give the
 option for them to edit the items - again, not a problem in populating the
 form - until I have to then use the UPDATE function, how can I update each
 item in separate tables when I use the above join to grab the info in the
 first place?  I've never had to write to 2 tables at once where data is
 relative like this, infact it was my first time of using JOINS at all to
 even display the data.



 I'm using PHP with MySQL.



 Thank you.



 Chris

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