Re: [PHP-DB] grabbing id from new record
Hi. What about Auto_increemnt field ?? Your's id can be auto_increment field. for example: create table dupencja (id int(7) auto_increment not null, primary key(id)); so when you insert records: insert into dupencja values('') - id will be 1 insert into dupencja values('') - id will be 2 this is auto_increment, so your trick isn't need. More in manula of mysql. regards. I piasecki - www.b-c.pl - Original Message - From: George Pitcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 14, 2002 3:23 PM Subject: [PHP-DB] grabbing id from new record Hi, Is there a way to grab the ID (from ID field) while INSERTing a new record? I am currently doing a separate INSERT then a SELECT query to find the most recently added record by that user: select ID from table where user = '$user' order by ID DESC limit 0,1 This does the trick but it may not be the most efficient way. George --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.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] -- Znudzilo Ci sie logo w komorce? Wgraj nowe [ http://komorki.onet.pl/dodatki.html ] -- 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] Problem with buttons
- Original Message - From: markus|lervik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 27, 2001 9:47 AM Subject: [PHP-DB] Problem with buttons Hello everyone! Does anyone know what the problem might be with the following little php-snippet? print(TR TD COLSPAN=\4\ ALIGN=\CENTER\INPUT TYPE=button VALUE=\Previous page\ onclink=\parent.location='index.php?nav=truego=prev';\/TD); ^^ It's should be onclick :) Regards, I. Piasecki. print( TD COLSPAN=\4\ ALIGN=\CENTER\INPUT TYPE=button VALUE=\Next page\ onclick=\parent.location='index.php?nav=truego=next';\/TD/TR); The next button works perfectly, but for some strange reason nothing happens when one hits the previous button. *sigh* I don't want to be coding today.. I want to be at home listening to the BBC 13 CD Lord of the Rings dramatization. *grin* Cheers, Markus -- 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] -- Tego nie znajdziesz w zadnym sklepie! [ http://oferty.onet.pl ] -- 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] Lost connection to MySQL server during query
Hi evryone ! I have folowing error during execute my php3 script. Warning: MySQL Connection Failed: Lost connection to MySQL server during query in /home/sw81/public_html/miss_wiosna_01/info.php3 on line 59 This happened somtimes. Can i do something with it ?? Ireneusz Piasecki webmaster www.b-c.pl KomNet s.c [EMAIL PROTECTED] tel: 0 606 356 235 [EMAIL PROTECTED]
[PHP-DB] Problems with PHP4.0.4pl1 and mysql, when mysql uses another charsets(latin2)
Hi everyone ! I'm from Poland. I set in mySql server, that it can work with Latin 2 charset All is fine, but when i try accessing to databases through php 4.0.4pl1 a have error like below Warning: MySQL Connection Failed: Can't initialize character set 9 (path: default) in /home/httpd/html/test.php4 on line 3 Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/httpd/html/test.php4 on line 4 My system is: Linux RedHat 6.2 apache 1.3.12 PHP 4.0.4pl1 as shared module for apache. I see that it is php module bug. I have apache and php 4.0.4pl1 on my win98 machine. That errors don't occur. What can i solve this problem ?? Ireneusz Piasecki webmaster www.b-c.pl KomNet s.c [EMAIL PROTECTED] tel: 0 606 356 235 [EMAIL PROTECTED]