Re: [PHP-DB] Newby variable error

2004-09-15 Thread graeme
e the following array(2) { ["beans"]=> string(16) "Ethiopian Harrar" ["quantity"]=> string(1) "3" } Notice that beans and quantity are in double quotes. From now it should be east to fix ;) graeme. W Roothman wrote: Wizards, I am VERY new to PHP,

Re: [PHP-DB] Capturing a sql query

2004-10-03 Thread graeme
Just a thought, Could you use the set data type rather than a text to store your multiple selections? graeme. Stuart Felenstein wrote: It's more then keywords actually. There are 3 list boxes, one for states, one for industries and one for taxterm., so 50 states , industries, something li

Re: [PHP-DB] Generate Menu based on database structure

2004-10-06 Thread graeme
Hi, Rather than writing a recursive function I'd suggest that you create a menu class and store each record as an object of the class. The menu class will have variables of id, parent, title, children, and tree. The children will be initialised to 0 and tree will be initialised to 1. You will n

Re: [PHP-DB] Loading large volumes of data

2004-10-07 Thread graeme
nsert and the occasional re indexing) graeme. Evan Morris wrote: This is more a process question that is not specific to PHP, but maybe someone can help me. I have a text file containing strings. The text file is pretty massive, about 895 MB. I need to load the words in the text file into the databa

Re: [PHP-DB] session_destroy();

2004-11-10 Thread graeme
roy(); However my problem is that if I recreate the session in the same script the session file is created with exactly the same file name and creation time. Making me believe that the session is held in cache somewhere graeme. Chris Payne wrote: Hi there everyone, I need to destroy a session in

Re: [PHP-DB] Question: For no results

2004-12-03 Thread graeme
You might want to use: mysql_num_rows -- Get number of rows in result Stuart Felenstein wrote: I want to send back a message when no matches are found on my search page. Basically "No matches found". I assumed that mysql_fetch_assoc would be the determining factor on whether any rows will com

Re: [PHP-DB] New to the Mailing List

2004-12-23 Thread graeme
Try using the if statement. Ben wrote: Morning all. I attach a document, which is used to send an email with attachments. What I need to do though, is if a form field is left blank, then that tag is not included in the email. Any clues anybody? It is vital that no information is sent for blank fiel

Re: [PHP-DB] data is not entering in created database

2004-12-24 Thread graeme
I suspect that your $submit is not set up, try the following echo statements before the if statement: echo "--$submit--"; echo "--$_POST["submit"]--"; amol patil wrote: hallo , i have wriiten simple php script , below. created databse "dollar1_allinfo" with table 'totalinfo' but on clicking submi

Re: [PHP-DB] want to execute comments on new pages after clicking submit.

2004-12-24 Thread graeme
n you are expecting to enter the if($submit) clause. I hope that clarifies it a bit. all the best, graeme. amol patil wrote: hallo, i wrote this echo "Submit = $submit"; before 'if statement' but , the sentences in echo statements are executing on same pages , showing

Re: [PHP-DB] how to connect new html page in PHP.

2004-12-25 Thread graeme
o 'Also the name attribute is the variable name that will be held in the $_POST variable'; ?> in file Page2.php \n"; echo 'The submit variable is held in the $_POST variable'; echo $_POST["submit"]; echo "To find out what has been POSTed use the var_dum

Re: [PHP-DB] str_replace question

2005-01-05 Thread graeme
Hi, Wild guess but does the original WHILE AND have two spaces between the WHILE and the AND? us an echo before and after and count the number of spaces. But yes it would be possible to avoid this with the judicious appearance of an if statement. graeme Chris Payne wrote: Sorry if this already

Re: [PHP-DB] PHP query to mysql database returns emtpy data, but Query Browser shows records

2005-01-05 Thread graeme
Hi, You have: $query example = SELECT description from cpProducts where category='39 47 48 172' don't you want to add a logical operator such as OR, possibly AND $query example = SELECT description from cpProducts where category='39 OR 47 OR 48 OR 172' graeme. Jason

Re: [PHP-DB] PHP query to mysql database returns emtpy data, but Query Browser shows records

2005-01-06 Thread graeme
hat are produced. Maybe is is a double digit and two spaces trip[le digit and one? Without an example of the data and what is produced it's hard to help. graeme Jochem Maas wrote: graeme wrote: Hi, You have: $query example = SELECT description from cpProducts where category='39 47

Re: [PHP-DB] SQL statement

2005-01-07 Thread graeme
Hi, To stop the return receipt dialog appearing in Tbird... Tools... Options... Advanced... Return Receipt and select "Never send a return receipt." Or you can choose some of the other selections. graeme Jochem Maas wrote: Jason, can you please turn off the return receipts on emails y

Re: [PHP-DB] Problem using session bu submitting the session id through a form

2005-01-08 Thread graeme
cho $id ?> method=post> If you run this and don't get the session ID being maintained then there would appear to be some problem with your set up but we'll probably require more info OS php version etc. graeme. Henk Jan Wils wrote: Hi, My session only seems to work when

Re: [PHP-DB] Slow Query

2005-01-13 Thread graeme
client. (that should allow for more than one client entering data at the same time, although you may want to properly think that scenario through) graeme. Wendell Frohwein wrote: First of all I would like to thank anyone who lends a hand in this matter. Here is what im working with. Redhat 9, PHP

Re: [PHP-DB] Input ++90 causing problems

2005-01-14 Thread graeme
It appears as plus sign and numbers on my computer. graeme. ioannes wrote: It appears that the code below in short has the following problematic strings: ++90 ++90-212- gives ï ï212- on my test page below: error2.htm. A clue might be that a search on google turns up Arabic unicode, and the

Re: [PHP-DB] Input ++90 causing problems

2005-01-15 Thread graeme
with a u on top. I suspect that it is an issue with the encoding. Have you tried to state the encoding to use in your HTML? graeme ioannes wrote: When I copy the php page and paste in a new page, upload that, and view with the same ? variables, it works (the css works and no js errors), however

Re: [PHP-DB] Assistance on Query

2005-01-16 Thread graeme
Can you do what you require by grouping by your type. setting a count field and then a where count > 3? However if you then need to know the details from the three consecutive fields then I don;t think it can be done in SQL so you'll need to revert to php. graeme Jochem Maas wrote:

Re: [PHP-DB] Dealing With MySQL's new Time Calculations

2005-01-16 Thread graeme
Set your select to group by userid, select on min(tourney.start) value and max(tourney.start) value where closed = 1 etc. graeme. [EMAIL PROTECTED] wrote: I have an interesting problem I'm trying to solve. Right now, I'm keeping track of sessions starting and ending times with a PH

Re: [PHP-DB] Dealing With MySQL's new Time Calculations

2005-01-16 Thread graeme
Sorry that should have been max(tourney.finish) :-[ graeme graeme wrote: Set your select to group by userid, select on min(tourney.start) value and max(tourney.start) value where closed = 1 etc. graeme. [EMAIL PROTECTED] wrote: I have an interesting problem I'm trying to solve. Right now

Re: [PHP-DB] i am lost (php warning)

2005-01-18 Thread graeme
MySQL result. Try adding the following: if (!$sql_query) { die('Invalid query: ' . mysql_error()); } graeme Earl Clare wrote: Hi ya'll, I am lost as to why I am getting this error in my script. Can anyone kindly explain why this is so. Warning: mysql_num_rows(): supplied argument

Re: [PHP-DB] foreach()

2005-01-31 Thread graeme
try... $z = array('foo' => array('bar'), 'dis' => array('dat')); foreach($z as $key => $value) { echo "$key $value[0] "; } graeme. Yemi Obembe wrote: Hi folks. wat can be done to dis: $z = array('foo' => array('bar'

Re: [PHP-DB] foreach()

2005-01-31 Thread graeme
or even... $z = array('foo' => array('bar'), 'dis' => array('dat')); while (list($key, $val) = each($z)) { echo "$key $val[0]"; } You need to remove the superfluous close bracket on after bar, and the val is an array hence $val[0] to get the

Re: [PHP-DB] timestamp

2005-01-31 Thread graeme
Can you post your code up and tell us what system you are using? cheers, graeme Balwant Singh wrote: dear bastien thanks for the reply... but i checked it again but it is giving only 1970-01-01. is something else needs to be done. with best wishes balwant On Mon, 2005-01-31 at 19:46, Bastien

Re: [PHP-DB] timestamp

2005-01-31 Thread graeme
The code works fine on my system, so what version of php are you using and what is your operating system? graeme. Balwant Singh wrote: i just copy your code and paste into a test file. ?> with best wishes balwant On Tue, 2005-02-01 at 10:33, Bastien Koert wrote: pls post relevant c

Re: [PHP-DB] timestamp

2005-01-31 Thread graeme
what output do you get from the following? "; $date = date("Y-m-d",strtotime($timestamp)); echo $date .""; phpinfo(); ?> graeme wrote: The code works fine on my system, so what version of php are you using and what is your operating system? graeme. Balwant Singh wrot

Re: [PHP-DB] Connecting To Mysql through php/mysqli

2005-02-02 Thread graeme
I like the idea of a mysqli_queasy() function. Maybe it would allow you to sumbit SQL statements that don't conform to any standard? ;) graeme. Bastien Koert wrote: the second error is a misspelling in the mysqli_query command bastien Call to undefined function mysqli_quesry() in C:\A

Re: [PHP-DB] password in md5 to connect to mysql instead of clear password

2005-02-25 Thread graeme
file. graeme. Gael Lams wrote: Hi all I use the classic following rows to connect to a mysql database. I always put $passsword in clear in the php connection file and I wonder whether there is a way to have it in md5 so that someone reading the file could not use it to connect to the db. I googled a bi

Re: [PHP-DB] Why isn't this working?

2005-02-26 Thread graeme
For more efficient code try the explode() function (You really only want to use the regular expression functions for complex pattern matching, looking for a comma is about as simple as it gets so use the standard string functions) explode (',',$Agent_Rep); graeme. Rasmus Lerdorf wr

Re: [PHP-DB] changing output method

2005-03-01 Thread graeme
Try putting your print "\t$col_value\n" immediately after the foreach... foreach ($line as $col_value) print "\t$col_value\n"; remember to remove teh semi-colon after the foreach line. graeme. chintan wrote: as usual my database is in mysql and there are lots of rec

Re: [PHP-DB] MySql and PHP question

2005-04-06 Thread graeme
From memory earlier versions of MySQL don't support subselects. The latest (and greatest) does so you may want to check the version you are using - I can't remember when it was introduced, I have since switched to PostGreSQL... all the best, graeme. Juffermans, Jos wrote: Hi, I&

Re: [PHP-DB] php and tables

2005-04-17 Thread graeme
1st Get your SQL to ORDER BY points DESC 2nd use PHP to get the details on row at a time and display the results in an HTML table. The specifics will depend on what your table looks like, for example if you don't have a points column then you may need to get SQL to calculate it. graeme.

Re: [PHP-DB] MySQL JOIN query : Seeking solution - Please Help

2005-04-20 Thread graeme
Get those with transaction into a php array Get those without transaction into a php array Then use array_diff() (or one of its variants) graeme. jinxed wrote: I am still new to this, but I turned the manual upside down, or at least I tried. I am designing a payroll application by which payslips

Re: [PHP-DB] printf() in a variable, or alternative to printf()

2005-05-27 Thread graeme
Are you looking for the sprintf() function? graeme mayo wrote: I need to be able to format data. Printf() is perfect because I need a certain amount of characters (30 for address). However I need this formatted data to be inside a file that's fwrite() and then FTPed to a distributo

[PHP-DB] pg_put_line and file()

2001-01-27 Thread Graeme Merrall
ed an error to occur. The example in the docs had the new lines and tabs escaped so I tried that as well with addslashes() $text = file("test.sql"); $db = pg_connect("host=localhost dbname=graeme user=graeme"); pg_exec($db, "COPY test FROM stdin"); foreach($text as $lin

[PHP-DB] Informix user wierdness

2001-03-31 Thread Graeme Merrall
to occur so it's obviously something in the setup. My sqlhosts line is 'demo_se seipcpipdev sqlexec' and the ifx_connect line is 'ifx_connect("stores7@demo_se", "testuser", "mypasswd")' Cheers, Graeme -- PHP Database Mai

[PHP-DB] RE: Informix user wierdness

2001-04-01 Thread Graeme Merrall
comp.databases.informix on google/deja on shadow and PAM etc will reveal the problem. Apparently there are workarounds for this but I haven't found the, yet. I suspect they will require surgery to something important :) Cheers, Graeme -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

[PHP-DB] Mail Function

2004-01-30 Thread Graeme McLaren
Evening all, I've written a script which sends emails, there is no problem with that. I was wondering how I can check for email bounces, anyone know how to do that? Cheers, G :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] test post

2004-01-30 Thread Graeme McLaren
please delete this -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Help -- Oracle

2002-01-24 Thread Graeme Merrall
I've tried all sorts of possibilities. path to tnsnames.ora is correct. > I've even tried with ODBC but when i used it with php, i get > "server refused > connection". However, ODBC test was successfull and other apps > can work with > it. Can you give us the exact

Re: [PHP-DB] PHP and OCI NLS behaviour

2002-04-16 Thread Graeme Merrall
alter some Oracle defaults, it may well be too late because that option has already been set then the module was loaded (i.e. when Apache starts). Cheers, Graeme -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] INSERTing INTO Multiple Tables with MySQL & PHP

2002-09-03 Thread Graeme McLaren
od. Thank you in advance for any help - I'm lost! Graeme :) Public Sub House() On Error Resume drink If Pint.empty = True Then Pint.refill Else Pint.drink End if stomach.add Pint MsgBox " I've had " & stomach.

[PHP-DB] mysql_fetch_assoc question

2002-09-04 Thread Graeme McLaren
ad and insert that into the Lookup table. Any ideas how I can just extract this value? I'm also not 100% clear on what "mysql_fetch_assoc" does, can anyone explain it? Cheers in advance, Graeme :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Inserting checkbox data

2002-10-25 Thread Graeme McLaren
27;, Password = '$Password', GiftWrapping = '$GW'"; } Thank you in advance for any help. Graeme :) Public Sub House() On Error Resume drink If Pint.empty = True Then Pint.refill Else Pint.d

Re: [PHP-DB] Inserting checkbox data

2002-10-25 Thread Graeme McLaren
Mihail, thanx for your advice, I've got it going now ! :) Thank you ! Richard, your points were valid, the HTML code with the slashes was just a copy n' paste from a PHP script and the comma I think I deleted by accident so its all sorted now. Thank you again! Graeme :) - Origin

[PHP-DB] Dealing with Unchecked Checkboxes

2002-10-26 Thread Graeme McLaren
y" can anyone point me in the right direction? $number=count($GiftWrapping); for($a=0;$a<$number;$a++) { echo $GiftWrapping[$a]; if ( empty( $GiftWrapping ) ) { $GW = 'N'; } INSERT INTO DB CODE HERE GiftWrapping = '$GW'"; } Cheers in advan

Re: [PHP-DB] Dealing with Unchecked Checkboxes

2002-10-26 Thread Graeme McLaren
Mihail, do u mean something like this? $pick[$i] is Checked"; } } ?> Painting Plumbing Electric Cheers, Graeme :) - Original Message - From: "Mihail Bota" <[EMAIL PROTECTED]> To: "Micah Stevens" <[EMAIL PROTECTED]> Cc: <[EMAIL PROT

Re: [PHP-DB] Dealing with Unchecked Checkboxes

2002-10-28 Thread Graeme McLaren
Hi all, thanks for all your replies, I got the problem with checkboxes fixed :) Cheers, Graeme :) - Original Message - From: <[EMAIL PROTECTED]> To: "Graeme McLaren" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, October 28, 2002 3:53 PM Subjec

[PHP-DB] Infinite Loop?

2002-11-02 Thread Graeme McLaren
$message = "If you get this then age3.php works" $message = "If you get this then age3.php works"; mail($sendto, $subject, $message); } } Cheers, Graeme :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Infinite Loop?

2002-11-02 Thread Graeme McLaren
t now. Thanks for your advice. Graeme :) On Sat, 2002-11-02 at 20:41, Jason Wong wrote: > On Sunday 03 November 2002 04:26, Graeme McLaren wrote: > > Greetings list members. I've written the code below as part of an > > automatic email script. The problem with this is it

[PHP-DB] PHP & Case Sensitivity

2002-11-03 Thread Graeme McLaren
ed to use $Year, the case insensitivity didn't seem to make a blind bit of difference. I've corrected it now and the script runs as it did previously. Did PHP just correct this at run time? Anyone know why this worked? Cheers, Graeme :) P.S. Seabird: I had a quick look at your si

[PHP-DB] Re: mysql_fetch_array() question

2002-11-04 Thread Graeme McLaren
Hi everyone, I think I've got the problem sorted, I'll soon let y'all know if it doesn't work ! Cheers, Graeme :) On Mon, 2002-11-04 at 21:47, Graeme McLaren wrote: > Hi, Anyone know how I can use two mysql_fetch_array() functions similar > to the code below? I

[PHP-DB] mysql_fetch_array() question

2002-11-04 Thread Graeme McLaren
umped with this one, Graeme :) $query = "SELECT Name, Address FROM users"; $query2 = "SELECT EmailAddress From Members"; $result = mysql_query($query); $result2 = mysql_query($query2); while($details = mysql_fetch_array($result) and $Email = mysql_fetch_array($result2)) {

Re: [PHP-DB] mysql_fetch_array() question

2002-11-06 Thread Graeme McLaren
work with one mysql result per connection at a time". Can you explain a little more about that please? I don't think I fully understand what you mean. Cheers, Graeme :) - Original Message - From: "Josh Johnson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> S

RE: [PHP-DB] Postgres auto increment.

2001-04-13 Thread Graeme Merrall
ue of your primary key field. That should do it, my postgres is a bit rusty tho. Cheers, Graeme -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

RE: [PHP-DB] ORACLE 8 randomly unsucessful execution

2001-06-22 Thread Graeme Merrall
Do you get an Oracle error code back? What version of PHP are you using? Cheers, Graeme > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf > Of Ludo > Sent: Saturday, 23 June 2001 1:31 AM > To: [EMAIL PROTECTED] > Subject: [PHP-

RE: [PHP-DB] MSSQL: Spaces in database name

2001-08-08 Thread Graeme Merrall
(and maybe ODBC?) syntax. Using square brackets will work on most things including table names and field names with spaces in them. This will work fine SELECT [table space].[field space] FROM [table space] It doesn't mean that you should go around putting spaces in your database obje

Re: [PHP-DB] OCIDefineByName/OCIBindByName help?

2001-08-13 Thread Graeme Merrall
seful for pulling columns out of Oracle so you don't need to make calls to ociresult() all the time. I actually don't see much benefit over using fetchstatement() Cheers, Graeme Cheers, Graeme -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP-DB] OCIDefineByName/OCIBindByName help?

2001-08-13 Thread Graeme Merrall
seful for pulling columns out of Oracle so you don't need to make calls to ociresult() all the time. I actually don't see much benefit over using fetchstatement() Cheers, Graeme Cheers, Graeme -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP-DB] oracle (oci8) intro

2001-08-19 Thread Graeme Merrall
er, ROWNUM does not listen to sorting which makes life amusing. One option is to try a query like the following: "SELECT * FROM (SELECT field1, field2 FROM table WHERE id>10 ORDER BY field1 DESC) WHERE ROWNUM<11" which gives you 10 rows, but still leaves the question of paging

Re: [PHP-DB] Oracle Oci*Logon

2001-08-21 Thread Graeme Merrall
> machine under Linux(RH), what have to be done to make my PHP work with > the > DB. Windows is a slightly different beast. Normally the environment stuff is handled in windows and you don't need to setup anything with putenv. Use your Net8 Configuration assistant which is part

RE: [PHP-DB] Oracle date conversion

2002-01-12 Thread Graeme Merrall
would certainly stop you having to rewrite the query. As David pointed out though, using TO_CHAR and it's mate TO_DATE is by far the best way to go. Cheers, Graeme -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

Re: [PHP-DB] basic php question

2003-09-03 Thread Graeme McLaren
eNo and emp2.EmployeeNo = '$EmployeeNo'"); if(mysql_num_rows($query) == 1) { mysql_query("update emp2 where emp2.id = '$SomeValue'"); } else { mysql_query("insert into emp2 set X = '$X'"); } hope this helps, Graeme :) - Original

[PHP-DB] Replacing "+" with " " question

2003-09-30 Thread Graeme McLaren
Line1 = str_replace(" ", "+", $AddressLine1); echo "First Line Of Address: "; Cheers, Graeme :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Replacing "+" with " " question

2003-09-30 Thread Graeme McLaren
symbols with a space " " only the part up to the first space is displayed back to the user. Any ideas? Cheers again, Graeme :) - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 30, 2003 7:12 PM Subject:

[PHP-DB] Query works but can't echo variable :'(

2003-10-26 Thread Graeme McLaren
Hey everyone, the following query and code works fine but I can't understand why I can't echo the $Date variable. I guess it doesn't work fine then :( Any ideas ? G :) $TheDate = mysql_query("select DATE_FORMAT(DateOfOrder, '%d, %m, %Y') as date from Orders Where Orders.ID = '$TransID'"); whil