[PHP-DB] Creating query with multi-dimensional array

2004-02-26 Thread lisi
I have a form that allows users to edit an entry in a database. It displays the current values in a textbox/select box/textarea depending on the type of data (text, enum, etc). The same form is used for different tables, so no values are hard coded. Field names are retrieved with a show

[PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
I've just tried to do something I've done a thousand times. It does not work. I've checked all of the syntax, made sure the field and variable names are correct. No matter what I do it just doesn't work. The table remains empty. Here's the query: $logit = mysql_query(INSERT INTO log SET

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Ricardo Lopes
What is the error? there i something i always do when i have this problem, try this: error_reporting(E_ALL); $sql = INSERT INTO log SET term='$search', returns='$arrayword', time=CURTIME(), date=CURDATE(), ip='$ip'); echo $sql; $logit = mysql_query($sql); This makes all kind of notice about

RE: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Paul Fitz
You haven't done that a thousand times - the syntax is wrong :). You are using a combo of INSERT and UPDATE syntax there. Try INSERT INTO log (term, returns, time, date, ip) VALUES ('$search', '$arrayword',CURTIME(), CURDATE(), '$ip'); Cheers, Paul -Original Message- From: Axel IS

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Muhammed Mamedov
Try this: $logit = mysql_query(INSERT INTO log (term,returns,time,date,ip) VALUES ('$search','$arrayword',CURTIME(), CURDATE(), '$ip')); Regards, Muhammed Mamedov turkmenweb.com - Original Message - From: Axel IS Main [EMAIL PROTECTED] To: PHP-DB [EMAIL PROTECTED] Sent: Thursday,

[PHP-DB] Database Search Engine ?

2004-02-26 Thread Muhammed Mamedov
Anyone knows/uses IMP database search engine? http://www.imptechnology.com/DesktopDefault.aspx?tabid=56 Thanks, M.Mamedov

Re: [PHP-DB] Database Search Engine ?

2004-02-26 Thread Joshua D. Drake
Hello, I suggest PostgreSQL+TSearch2+OpenFTS... 30 minutes to a wonderful search engine. On Thu, 26 Feb 2004, Muhammed Mamedov wrote: Anyone knows/uses IMP database search engine? http://www.imptechnology.com/DesktopDefault.aspx?tabid=56 Thanks, M.Mamedov -- Co-Founder Command

[PHP-DB] call to undefined function mysql_connect() [PHP / MySQL / Red Hat 8]

2004-02-26 Thread Jono
Hey. I've just installed Red Hat 8 from a downloaded distribution and have set up Apache, PHP and MySQL. The problem I have is my old code that I wrote in a Windows environment doesn't work. The error I get is: call to undefined function mysql_connect() I know that Apache is running fine and I

[PHP-DB] problem in creating a connection

2004-02-26 Thread devil_online
Hi, i use phpmyadmin I i cant conect to my database. I use this code: ? /** * Connect to the mysql database. */ $conn = mysql_connect(localhost, username, PASSWORD) or die(mysql_error()); mysql_select_db('test', $conn) or die(mysql_error()); ? and it gives me this error: Warning:

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
Ok guys, I found the problem. It's actually something I've run into before. If you take a look at the query you'll notice that one of the fields is named returns. When I created the test table with phpMyAdmin it created it and everything seemed fine. Then I decided to try something. I tweaked

[PHP-DB] Re: call to undefined function mysql_connect() [PHP / MySQL / Red Hat 8]

2004-02-26 Thread JeRRy
To: [EMAIL PROTECTED] From: Jono [EMAIL PROTECTED] Date: Wed, 25 Feb 2004 20:50:37 - Subject: call to undefined function mysql_connect() [PHP / MySQL / Red Hat 8] Hey. I've just installed Red Hat 8 from a downloaded distribution and have set up Apache, PHP and MySQL. The problem I

Re: [PHP-DB] Re: call to undefined function mysql_connect() [PHP / MySQL / Red Hat 8]

2004-02-26 Thread Ricardo Lopes
Call to undefined function mysql_connect(), this means that php doesnt reconize mysql_connect() as a function, this could be because you use the wrong name for the function (in this case it seems ok, check your code), or because the mysql extension isn't loaded (it is loaded by default, and it

RE: [PHP-DB] What's wrong with this query?

2004-02-26 Thread brett king
I agree this is a valid format. People should check the manual before making statements that are untrue to the list server. Axel did you get an error message or just no update? -Original Message- From: Nitin Mehta [mailto:[EMAIL PROTECTED] Sent: 26 February 2004 12:26 To: Erwin Kerk;

Re: [PHP-DB] Re: call to undefined function mysql_connect() [PHP / MySQL / Red Hat 8]

2004-02-26 Thread Jono
Yeah thanks for the phpinfo() tip. I guess I know that MySQL isn't working with PHP cos I'd already checked that. Bit silly I presumed that installing it all at the same time as installing Linux it would all work together. In the package manager for RedHat, under the Web Server Section, PHP is

[PHP-DB] OCINewCollection

2004-02-26 Thread MARKOV Todor RO/DRSA/DIP
Hi I am looking for some help with the OCINewCollection function. My pb is that I whant to get a PLSQL stored procedur OUT parameter of TYPE my_type of collection( TABLE ...) back in my PHP script as array Please help me ... P.S. I am very newby in the list so if my question is stupid

[PHP-DB] PHP ODBC and Pervasive.SQL

2004-02-26 Thread Pascal Schaedeli
Hi, I am executing a SELECT query from PHP (4.3.4) through ODBC on a Pervasive 2000SP4 (all on Windows). odbc_result_all, odbc_fetch_into, and all other php odbc function stop returning records before the end of the effective resultset. Here is what is happening : * In Pervasive: SELECT * FROM

Re: [PHP-DB] Re: call to undefined function mysql_connect() [PHP / MySQL / Red Hat 8]

2004-02-26 Thread Jono
Okay, there is no mysql.so module in /usr/lib/php4 (my extensions dir), which basically says to me that no matter what i do i won't get mysql support unless it is there, even if I uncomment it in my php.ini file. Can I download it from somewhere and just plonk it in the extensions dir, or does it

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
Actually, yes, a thousand times is an obvious exaggeration, but I have done a whole lot of times, and the query syntax is the query syntax. Different don't make it wrong. This is working in several other places throughout this particular set of scripts. Paul Fitz wrote: You haven't done that

Re: [PHP-DB] PHP ODBC and Pervasive.SQL

2004-02-26 Thread Robert Twitty
Hi Pascal The odbc extension uses ODBC 2, while Access and Pervasive are most likely using ODBC 3. This may or may not be the cause of your problem. Try using the odbtp extension at http://odbtp.sourceforge.net. It uses ODBC 3, and may give you better results. -- bob On Wed, 25 Feb 2004,

RE: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Hutchins, Richard
Been kind of following this thread off and on... If the syntax is acceptable by MySQL, which it appears to be, is it possible that the variables you are using within the query string are not set to anything? Or is it possible that there is something broken immediately before the query string is

[PHP-DB] passing parameter to function

2004-02-26 Thread Robbie Staufer
Hi, Say I have a script that knows the value of a variable $codename. The script contains a function that needs to know the value of $codename. What is the syntax for passing the parameter to the function? Example: the script knows that $codename = blah. The function has to pass 'blah' on to

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
An interesting thought. I tried this: echo Term: $search, Returns: $arrayword, UserIP: $ipbr; $logit = mysql_query(INSERT INTO log SET term='$search', returns='$arrayword', time=CURTIME(), date=CURDATE(), ip='$ip'); echo Query Value: $logit; And got this on the page: Term: skater, Returns:

Re: [PHP-DB] passing parameter to function

2004-02-26 Thread Robbie Staufer
Thanks for responding. script 1 receives the value of $codename from previous scripts - ultimately from user input. So in script 1, I can't hard-code the value as blah. Should have mentioned that before. Up to now, I've been using input type = 'hidden' name = 'codename' value='$codename'

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Micah Stevens
mysql_query does not return a specific value, rather a pointer to a range of values (depending on what the query returns..) so what you're seeing is normal. I think depending on your error settings, PHP will actually return the value as 'POINTER' or something like that to let you know it's not

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread jeffrey_n_Dyke
An interesting thought. I tried this: echo Term: $search, Returns: $arrayword, UserIP: $ipbr; $logit = mysql_query(INSERT INTO log SET term='$search', returns='$arrayword', time=CURTIME(), date=CURDATE(), ip='$ip'); echo Query Value: $logit; And got this on the page: Term: skater, Returns:

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Micah Stevens
Right.. a resource.. sorry. On Thursday 26 February 2004 12:55 pm, [EMAIL PROTECTED] wrote: An interesting thought. I tried this: echo Term: $search, Returns: $arrayword, UserIP: $ipbr; $logit = mysql_query(INSERT INTO log SET term='$search', returns='$arrayword', time=CURTIME(),

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Micah Stevens
Good point, but all you needed to do is surround the field name with back quotes.. i.e.: $logit = mysql_query(INSERT INTO log SET `term`='$search',`returns`='$arrayword', `time`=CURTIME(), `date`=CURDATE(), ip='$ip'); I think phpmyadmin does this automatically, which is why that worked.

[PHP-DB] HELP!!!

2004-02-26 Thread Robin 'Sparky' Kopetzky
Good afternoon! I used SQLYOG to export the tables and data from a Mysql database. Now, when i try to re-import the data back into a different database, I get an error stating Error : MySQL server has gone away. What is happening and how do I fix this. I NEED this script to execute badly. I even

Re: [PHP-DB] SQL File Import problem (Was: HELP!!!)

2004-02-26 Thread Doug Thompson
On Fri, 27 Feb 2004 01:16:20 +0100, Erwin Kerk wrote: Robin 'Sparky' Kopetzky wrote: Good afternoon! I used SQLYOG to export the tables and data from a Mysql database. Now, when i try to re-import the data back into a different database, I get an error stating Error : MySQL server has gone

RE: [PHP-DB] SQL File Import problem (Was: HELP!!!)

2004-02-26 Thread Robin 'Sparky' Kopetzky
Thank you to all who helped. I was able using UltraEdit to chop up the sql file and created all of the individual INSERT statements. Now, I'm up and running again. Slow but it worked! Thanks again! Robin Kopetzky -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] SQL File Import problem (Was: HELP!!!)

2004-02-26 Thread Erwin Kerk
Robin 'Sparky' Kopetzky wrote: Good afternoon! I used SQLYOG to export the tables and data from a Mysql database. Now, when i try to re-import the data back into a different database, I get an error stating Error : MySQL server has gone away. What is happening and how do I fix this. I NEED this

[PHP-DB] Re: Creating query with multi-dimensional array

2004-02-26 Thread Justin Patrin
Lisi wrote: I have a form that allows users to edit an entry in a database. It displays the current values in a textbox/select box/textarea depending on the type of data (text, enum, etc). The same form is used for different tables, so no values are hard coded. Field names are retrieved with

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread jeffrey_n_Dyke
Ok guys, I found the problem. It's actually something I've run into before. If you take a look at the query you'll notice that one of the fields is named returns. When I created the test table with phpMyAdmin it created it and everything seemed fine. Then I decided to try something. I tweaked

RE: [PHP-DB] passing parameter to function

2004-02-26 Thread Hutchins, Richard
Script 1: form name=myform method=post action=script2.php input type=hidden name=codename value=blah ...other form stuff as necessary... /form Submit the form. Script 2: Access the data passed in the hidden field as $_POST[codename]. For example, echo $_POST[codename]; Rich

RE: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Daniel Clark
What about the single quotes? Might try this. $sql = INSERT INTO log SET term=\'$search\', returns=\'$arrayword\', time=CURTIME(), date=CURDATE(), ip=\'$ip\'; $sql = INSERT INTO log SET term='$search', returns='$arrayword', time=CURTIME(), date=CURDATE(), ip='$ip'; echo $sql; $logit =

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Axel IS Main
Ok, ok. I get the message about the syntax. Since I've used this syntax for a long time and so far there hasn't been a problem I'll assume that's not the problem. I will, however, review this and probably make some changes for the sake of compliance if nothing else. In any event, the syntax is

Re: [PHP-DB] Re: call to undefined function mysql_connect() [PHP / MySQL / Red Hat 8]

2004-02-26 Thread Ricardo Lopes
you probably have the mysql and the php installed and working correctly. check your php.ini file search for a section named extensions and check if the mysql extension is commented (if so uncomment it), check is the entensions directory is correct, check the apache logs to see if php load

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Nitin Mehta
exactly, i'm using it for more than a year - Original Message - From: Erwin Kerk [EMAIL PROTECTED] To: [EMAIL PROTECTED]; PHP DB [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 5:36 PM Subject: Re: [PHP-DB] What's wrong with this query? Viorel Dragomir wrote: I'm using MySQL

Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Erwin Kerk
Viorel Dragomir wrote: I'm using MySQL for about 2 years and never heard about this kind of INSERT. Is not SQL compliant neither. YOU CAN NOT MAKE : INSERT INTO table SET var=1 [as I know] As a matter of fact it IS possible, according to the MySQL manual on http://www.mysql.com/doc/en/INSERT.html