[PHP-DB] AUTO_INCREMENT
hi, i have a problem i have a database table created with the statement: CREATE TABLE chatmessages (id tinyint(6) DEFAULT '0' NOT NULL AUTO_INCREMENT, message text, username varchar(100), UNIQUE id (id); I insert records with: INSERT INTO chatmessages (message, username) VALUES ('$message', '$username') this works fine (for a while), i can insert messages and retreive them with php. But after some time i get the error: ERROR 1062: Duplicate entry '127' for key 1 but how can this be because i've set it to AUTO_INCREMENT. can someone help me? thanks in advance Joris Kluivers
[PHP-DB] How can I implement Yahoo-like search?
How can I implement Yahoo-like search? For example: +WinZip +Mac in one of my field in my table 'software' ? TIA, Lisa -- 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] How can I implement Yahoo-like search?
Hi You can use the parsing functions of PHP 4.0 to replace the '+' with AND or OR and '-' with NOT and generate a SQL query into your table. Then, use links like a href='resultlink.php?id=12link=Link%20Result%20PageYour search result/a to display the results. Hope this helps Sridhar Ranganathan Madras, India From: "lisa elita" [EMAIL PROTECTED] Reply-To: "lisa elita" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP-DB] How can I implement Yahoo-like search? Date: Sun, 4 Mar 2001 20:21:33 +0700 How can I implement Yahoo-like search? For example: +WinZip +Mac in one of my field in my table 'software' ? TIA, Lisa -- 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] _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- 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] AUTO_INCREMENT
At 12:58 PM 3/4/01 +0100, Joris Kluivers wrote: hi, i have a problem i have a database table created with the statement: CREATE TABLE chatmessages (id tinyint(6) DEFAULT '0' NOT NULL AUTO_INCREMENT, message text, username varchar(100), UNIQUE id (id); I insert records with: INSERT INTO chatmessages (message, username) VALUES ('$message', '$username') this works fine (for a while), i can insert messages and retreive them with php. But after some time i get the error: ERROR 1062: Duplicate entry '127' for key 1 but how can this be because i've set it to AUTO_INCREMENT. can someone help me? thanks in advance Don't use tinyint. It only allows 128 values (0 to 127). Any values larger than 127 will go in as 127. Try smallint or int.Sounds like phpadmin, it defaults variables as tinyint = "To dwell within Samsara, however, is to be subject to the works of those mighty among dreamers." - Mahasamatman, in Zelazny's "Lord of Light" Andrew Apold -- 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] Re: Join statement and output
Norman, The SQL statement is this: select s.first_name AS s_name, t.first_name AS t_name, f.date from members s, members t, schedule f where s.first_name=f.member1 and t.first_name=f.member2 The AS is optional but it works the same as aliasing table names in the FROM clause. $s_name | $t_name | date Dan __ Subject: Join statement and output Date: Sat, 03 Mar 2001 22:43:27 -0800 From: Norman Tan [EMAIL PROTECTED] To: [EMAIL PROTECTED] No actual code, but hopefully, someone can help me through the theory here. I have 2 tables: members - first_name, last_name schedule - member1, member2, date The SQL statement is this: select s.first_name, t.first_name, f.date from members s, members t, schedule f where s.first_name=f.member1 and t.first_name=f.member2 Now the output would look something like this. | first_name | first_name | date | Question is, in PHP, how would I distinguish the two first_name fields? Database is currenly MySQL, but I would like this to be database independant. Thanks for your help. -- Norman Tan North Shore Interactive http://www.nsmb.com -- 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] Mail Form error
Thanx for all the help, it was so quick. I would have helped if I checked the manual first though :) Expecting the world to treat you fairly because you are a good person is a little like expecting the bull not to attack you because you are a vegetarian." Unix specialist Web Developer Bonzai Web Design http://www.bonzai.org.za - Original Message - From: "Randall Barber" [EMAIL PROTECTED] To: "Rudi Ahlers" [EMAIL PROTECTED] Sent: Sunday, March 04, 2001 9:14 PM Subject: Re: [PHP-DB] Mail Form error There are only 4 parameters allowed in the mail function, PHP4.0 Manual pg 535. mail($to, $subject, $message, $additional_headers); Thus for your purposes below, if ($ACTION == "send-mail") { mail($MYEMAIL,$TITLE,$NAME,$COMPANY,$CITY,$COUNTRY,$EMAIL,$NUM,"From: $EMAIL"); echo "h2Your information has been submitted./h2\n"; } else { echo "h2Use this form to submit your information./h2\n"; } ? Try this: $extra_header = "From: $EMAIL"; $subject = "Submitted Form"; $message = "$TITLE\n$NAME\n$COMPANY\n$CITY\n$COUNTRY\n$EMAIL\n$NUM"; mail($MYEMAIL, $subject, $message, $extra_header); Hope that helps RDB - Original Message - From: "Rudi Ahlers" [EMAIL PROTECTED] To: "PhP List" [EMAIL PROTECTED] Sent: Sunday, March 04, 2001 11:34 AM Subject: [PHP-DB] Mail Form error Can someone please tell me why this form doesn't work? I get the following error: Warning: Wrong parameter count for mail() in /home/www/projects/temp/mailform4.php on line 11 The code is as follows: html head meta name="Author" content="Chris Mills" /head body ?php $MYEMAIL = "root@localhost"; if ($ACTION == "send-mail") { mail($MYEMAIL,$TITLE,$NAME,$COMPANY,$CITY,$COUNTRY,$EMAIL,$NUM,"From: $EMAIL"); echo "h2Your information has been submitted./h2\n"; } else { echo "h2Use this form to submit your information./h2\n"; } ? buPlease fill in the form and then click submit:/u/b FORM METHOD=POST INPUT TYPE=HIDDEN NAME="ACTION" VALUE="send-mail" PRETitle: INPUT TYPE=TEXT NAME="TITLE"/PRE PREName: INPUT TYPE=TEXT NAME="NAME"/PRE PRECompany:INPUT TYPE=TEXT NAME="COMPANY"/PRE PRECity: INPUT TYPE=TEXT NAME="CITY"/PRE PRECountry:INPUT TYPE=TEXT NAME="COUNTRY"/PRE PREEmail: INPUT TYPE=TEXT NAME="EMAIL"/PRE PREContact number: INPUT TYPE=TEXT NAME="NUM"/PRE INPUT TYPE=SUBMIT * INPUT TYPE=RESET /FORM /body /html Thanx Rudi Ahlers -- 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 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]
SV: [PHP-DB] AUTO_INCREMENT
change CREATE TABLE chatmessages (id tinyint(6) DEFAULT '0' NOT NULL AUTO_INCREMENT, message text, username varchar(100), UNIQUE id (id); to CREATE TABLE chatmessages (id int(11) DEFAULT '0' NOT NULL AUTO_INCREMENT, message text, username varchar(100), UNIQUE id (id); mvh Knut -Opprinnelig melding- Fra: Joris Kluivers [mailto:[EMAIL PROTECTED]] Sendt: 4. mars 2001 12:59 Til: [EMAIL PROTECTED] Emne: [PHP-DB] AUTO_INCREMENT hi, i have a problem i have a database table created with the statement: CREATE TABLE chatmessages (id tinyint(6) DEFAULT '0' NOT NULL AUTO_INCREMENT, message text, username varchar(100), UNIQUE id (id); I insert records with: INSERT INTO chatmessages (message, username) VALUES ('$message', '$username') this works fine (for a while), i can insert messages and retreive them with php. But after some time i get the error: ERROR 1062: Duplicate entry '127' for key 1 but how can this be because i've set it to AUTO_INCREMENT. can someone help me? thanks in advance Joris Kluivers -- 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] thankx (AUTO_INCREMENT)
thankx for the reply's on my mail Joris Kluivers
[PHP-DB] NEWEST CRAZE
Hey...Janet Here... We Haven't Talked In So Long!! How Have You Been? Thought I would Forward you this email! I usually delete these but I opened this one, like what I saw, and thought you would like to see this. http://www.geocities.com/anewmarket/ IF THE LINK IS NOT HIGHLIGHTED OR YOU CANNOT CLICK ON IT. COPY AND PASTE IT IN YOUR BROWSER. -- 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] Looking for free temp hosting; php w/ oracle support
Hi. This semester I am enrolled in a database management class using Oracle. A couple of the projects we have to do ( coming in a few weeks ) is embedded SQL. I have convinced my instructor to let me use PHP for these projects. The problem is that our school server does not have PHP installed and won't do it just for me. I told the instructor that I could use my work's web server but, as it turns out, our webserver does not have php compiled with Oracle support and they refuse to do it since we don't use oracle in our operations. I then decided to set up PWS on my workstation with php. It took me a while but I finally got php running w/ Oracle connectivity on my own machine. It connects to the school Oracle server but runs the php from my computer. Then another problem came up. We moved our offices and with our new location we no longer have our own IP addresses. We are all behind a firewall and I can't run PWS. So now I am on the web asking for help. If anyone out there has a server running on the web with PHP installed and compiled with the OCI8 library, I would greatly appreciate it if you would allocate me a small amount of webspace for me to complete this class. I wouldn't take up much harddrive space at all, and it would only be for a couple months. The only processing power and bandwidth it would use would be when I tell my instructor the project is ready to grade and he connects and looks at it. I already have my tnsnames.ora file configured to connect to my school's oracle server. Drop me an email if you would be willing to help. Thanks. Doug Schasteen [EMAIL PROTECTED] -- 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] MySQL - Problem with multiple INSERTs?
Howdy, I'm getting weird problems trying to INSERT to two different tables, in consecutive mysql_queries. Before, I had 3 queries going, and only 2 would work at any time. It seemed like it was 'rotating' the bad query - first the 1st query would fail (the other two were fine), then I'd empty all my tables and refresh, and this time the 2nd query was the problem, and if I did it again the 3rd was. All queries worked fine in phpMyAdmin, both individually and when executed en masse. I've boiled it down to just two queries that don't work. I've included everything below (including table schemata), to enable reproduction. It seems like a bug to me - the question is, is the bug in PHP, MySQL, or my brain? This is driving me CRAZY - Chris mysql_connect("localhost", "myusername", "mypassword"); mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE files ( id tinyint(4) NOT NULL auto_increment, idProject tinyint(4) DEFAULT '0' NOT NULL, name tinyint(4) DEFAULT '0' NOT NULL, comment text NOT NULL, PRIMARY KEY (id) ); (P.S. I've tried things like using SET syntax, using mysql_query instead of mysql_db_query, etc. Nothing helps.)