Re: [PHP-DB] Strange bahavior with mysql_fetch_array($result)

2003-11-20 Thread Shahmat Dahlan
What of the sql statement? If your sql statement had mistakes in it (be it typo, or wrongly constructed statements), it will not even execute the if (!mysql_fetch_array($result)) { } portion of your code. You might want to construct your error checking portion differently as opposed to wha

[PHP-DB] Re: Strange bahavior with mysql_fetch_array($result)

2003-11-20 Thread Kirk Babb
Hi Evan, Try something like this instead: $query = mysql_query("SELECT product_id, product_name, purchase_date from MyTable ORDER BY product_id DESC"); if(!$query) { echo mysql_errno() . ": " . mysql_error() . "\n"; die; } else { //Now, for fun, display the results in a table with the re

Re: [PHP-DB] Strange bahavior with mysql_fetch_array($result)

2003-11-20 Thread Gerard Samuel
On Thursday 20 November 2003 08:54 pm, Evan Panagiotopoulos wrote: > I am searching a table and have the following php code with my > comments: > > $result = mysql_query($query); > print "The result == $result"; > // it returns The result == Resource id #2" > if (!mysql_fetch_array($result)) { > .

[PHP-DB] Strange bahavior with mysql_fetch_array($result)

2003-11-20 Thread Evan Panagiotopoulos
I am searching a table and have the following php code with my comments: $result = mysql_query($query); print "The result == $result"; // it returns The result == Resource id #2" if (!mysql_fetch_array($result)) { ... } else { while ($row = mysql_fetch_array($result)) { ... } } Neithe

Re: [PHP-DB] Read file

2003-11-20 Thread Ng Hwee Hwee
hi neil, this is indeed a very helpful piece of code and advice.. thank you so much! if this took you 30 minutes to write, it would have taken me a day to learn XML, and start writing! this code looks complicated for a young programmer like me ;p.. i'll need time to read up on XML and get back to

Re: [PHP-DB] Unsure of how to perform query and results..

2003-11-20 Thread CPT John W. Holmes
From: "Aaron Wolski" <[EMAIL PROTECTED]> > I have data in a Db that looks something like: > > 14,[EMAIL PROTECTED],Andrew,Smith > 1,[EMAIL PROTECTED],Andrew,Smith > 14,[EMAIL PROTECTED],Barbara,Richardson > 1,[EMAIL PROTECTED],Barbara,Richardson > > The number represents a product_id that was purc

Re: [PHP-DB] mysql table join

2003-11-20 Thread CPT John W. Holmes
From: "Roger Miranda (Sumac)" <[EMAIL PROTECTED]> > Is there a way to permanently join/link two mysql tables? Not without creating another table. CREATE TABLE MyTable SELECT ... FROM Table1 JOIN Table2 ON ... WHERE ... Although I have to wonder about your schema if you need to do this. ---Jo

Re: [PHP-DB] Access db

2003-11-20 Thread Michael Mauch
Luke Van Blerk wrote: > I'll probably just extract the data with an access to mysql script and run > it on mysql. This is probably the best approach if you have access to Windows machine. If not, might help. Regards... Michael -- PHP Da

[PHP-DB] SQLite

2003-11-20 Thread Bronislav Klučka
Hi, I was trying to work with SQLite, everything is OK, but it seems not to vork in thread, but in sequences. I mean: I perform a question which tooks 2 minutes, then another, which tooks 3 minutes, then I perform them both from 2 separated browser windows and both of them stops at the same time an

[PHP-DB] mysql table join

2003-11-20 Thread Roger Miranda (Sumac)
Hey everyone.. Is there a way to permanently join/link two mysql tables? Thanks, Roger -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] MySQL and PHP

2003-11-20 Thread Jose
I'm trying to connect to a MySQL database. I'm able to do it from mysql, I can see my databases and tables. When I try to see it from php I get the error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/test2.php on line 3 What I'm missing in the configuration? When I'm

[PHP-DB] Unsure of how to perform query and results..

2003-11-20 Thread Aaron Wolski
Hi Guys, I have data in a Db that looks something like: 14,[EMAIL PROTECTED],Andrew,Smith 1,[EMAIL PROTECTED],Andrew,Smith 14,[EMAIL PROTECTED],Barbara,Richardson 1,[EMAIL PROTECTED],Barbara,Richardson The number represents a product_id that was purchased by the customer in question. As you c

[PHP-DB] MySQL and PHP

2003-11-20 Thread Jose
I'm trying to work with MySQL 4.0.16-standard and PHP php-4.3.4 I'm getting the folowing error: Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/db_fns.php on line 5 Any Ideas what I am missing in the configuration. If I run phpinfo() I get: System Linux stripples

[PHP-DB] Can't connect to local MySQL

2003-11-20 Thread Jose
$link = mysql_pconnect("localhost", "bm_user", "password") or die("Could not connect : " . mysql_error()); Return : Could not connect : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) If I run shell>mysql -h localhost -u bm_user -ppassword Welcome to the MySQL

RE: [PHP-DB] Parse error on array and SQL query

2003-11-20 Thread Hutchins, Richard
If you're not getting the parse error anymore, I'd suggest you echo $query to the browser and check to see that the SQL statement is what you expect it to be. Can't count the number of times doing that has pointed out some stray apostrophe or comma or something that killed the query. > -Origin

Re: [PHP-DB] how obtain last id past insert?

2003-11-20 Thread pete M
depends which DB your using in mysql its "select last_insert_id()" and in mssql for example its "select @identity" have fun Pete Webmaster D.G.R.E.R. wrote: Hi: How i obtain inmediatly the id of last insert ? For example i have a forum, when the user post a question, i send a mail to adm

Re: [PHP-DB] Parse error on array and SQL query

2003-11-20 Thread John W. Holmes
Dillon, John wrote: > Tried that, doesn't work with: > > $query="INSERT INTO ReplyTbl VALUES ('" . $monster1 . "', '" . > $monster2 . > "', '" . $monster3 . "', NULL, NULL)"; > > Don't suppose they use 'monster' as a reserved word... How does it "not work" again?? -- ---John Holmes... Amazon Wish

RE: [PHP-DB] Parse error on array and SQL query

2003-11-20 Thread Dillon, John
Dillon, John wrote: > On line 188 and similar: > line 187$this=$altIDs[$i]; > line 188$query .= "ID='$this'"; > > I get the error: Parse error: parse error in > /home/jdillon/public_html/provreport.php on line 188 > > Could this be because some sett

Re: Re: [PHP-DB] Read file

2003-11-20 Thread Neil Smth
OK Error in my last post, the mail reader munged the HTML so if you need as source use the XML data below and hopefully the text below will appear as html code ;-) Cheers - Neil Demo Hotel Loader