RE: [PHP-DB] Please help me! :(
Can I ask why you're not using autoincrement for your id field? If you used this you would never have the problem your having. Everytime a record is added it will increment the id field by one, so you don't have to use all the code your using. Howard -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Sunday, 24 March 2002 3:42 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Please help me! :( I have a site where things in the database have ids. When something new is added, it gets an id one higher than the highest existing id. I use code something like this: $gethighestid = mysql_fetch_array(mysql_query(select id from table order by id desc limit 1)); $tobeid = $gethighestid[id]+1; mysql_query(insert into table(id,othercolumn,othercolumn2) values('$tobeid','something','something')); The thing is, I just got two rows with duplicate ids. Aparantley, two people must of added two things at just the right times to make the same id. Is there any way that will reduce, or eliminate, the time gap between getting id and inserting? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Please Help Me! thanks!!
Try using fsockopen() function : $file = fsockopen (www.yahoo.com, 80, $err_num, $err_msg, 30); You can find more informations about this fuction in http://www.php.net/manual/en/function.fsockopen.php May it help you. Andy www.mediahostnet.com --- G [EMAIL PROTECTED] wrote: Hello! i would like to useing fopen() fuction to open the other Url, but i am using a shared server now. When i useing fopen() or file() fuctions, always have a error message: Warning: php_hostconnect: connect failed in /usr/xxx/xxx/xxx/html/test.php on line 3 Warning: file(http://www.yahoo.com;) - Bad file descriptor in /usr/xxx/xxx/xxx/html/test.php on line 3 How can i do?have any other fuctions can do that? Thank You Very Much!! -- 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] __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.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]
RE: [PHP-DB] Please help me with this script...
-Original Message- From: Slider [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 9:27 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Please help me with this script... Hello, I've been working on this script all day, but I'm getting the same failure report each time: Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\motoerit\toon_alles.php on line 23 What could be wrong? This is the code I have: This usually means there was a problem with your query. For more info, including some useable sample code that should help you troubleshoot exactly what went wrong, see http://www.php.net/FAQ.php#7.12 --- Mark Roedel ([EMAIL PROTECTED]) || "There cannot be a crisis next week. Systems Programmer / WebMaster || My schedule is already full." LeTourneau University ||-- Henry Kissinger -- 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]