[PHP-DB] re: multiple queries in PHP ????
Hi, This is what I have so far. ? if ($REQUEST_METHOD == POST) { $usr = usr; $pwd = pwd; $db = db; $host = localhost; $cid = mysql_connect($host,$usr,$pwd); mysql_select_db($db); // NOTE that form fields automatically become variables $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner'; mysql_query($sql); echo(Points credited? I hope!brbr); } else {echo(An error occoured, please click back button and try again.);} ? Now is this right? ? if ($REQUEST_METHOD == POST) { $usr = usr; $pwd = pwd; $db = db; $host = localhost; $cid = mysql_connect($host,$usr,$pwd); mysql_select_db($db); // NOTE that form fields automatically become variables $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner'; if (match) { $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner': $sql = UPDATE profile SET update_table2; } mysql_query($sql); echo(Points credited? I hope!brbr); } else {echo(An error occoured, please click back button and try again.);} ? http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] re: multiple queries in PHP ????
Hi, I just noticed a problem with my question which would cause major problems in my db. So let me re-ask it again. How can I update 2 tables at once if a match occours from information inputed into a PHP form. Now this is what each table has. table1: id username game1 game2 game3 game4 game5 game6 game7 game8 score table2: id username password sid score I have this: $sql = UPDATE table1 SET score=score+1 WHERE $select='$winner'; mysql_query($sql); echo(Points credited? I hope!brbr); } else {echo(An error occoured, please click back button and try again.);} Now that works fine and updates correctly. But now I want a second table to be updated. So if username blah got +1 I need table2 to update it's score for blah to +1. The query above updates if it finda a match in table1 and does not require the use of a username to update. But for table2 I am guessing it WILL need to know the username or id to update the appropiate field and not update everyones score to +1. So how is this achieved? Or am I doing this a hard way? Jerry http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] re: multiple queries in PHP ????
ignore this, I no longer require assistance on the message below. ATTACHMENT part 6 message/rfc822 Date: Wed, 26 Mar 2003 19:41:32 +1100 (EST) From: JeRRy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: re: multiple queries in PHP Hi, This is what I have so far. ? if ($REQUEST_METHOD == POST) { $usr = usr; $pwd = pwd; $db = db; $host = localhost; $cid = mysql_connect($host,$usr,$pwd); mysql_select_db($db); // NOTE that form fields automatically become variables $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner'; mysql_query($sql); echo(Points credited? I hope!brbr); } else {echo(An error occoured, please click back button and try again.);} ? Now is this right? ? if ($REQUEST_METHOD == POST) { $usr = usr; $pwd = pwd; $db = db; $host = localhost; $cid = mysql_connect($host,$usr,$pwd); mysql_select_db($db); // NOTE that form fields automatically become variables $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner'; if (match) { $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner': $sql = UPDATE profile SET update_table2; } mysql_query($sql); echo(Points credited? I hope!brbr); } else {echo(An error occoured, please click back button and try again.);} ? http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] re: multiple queries in PHP ????
ignore this, I no longer require assistance on the message below. ATTACHMENT part 6 message/rfc822 Date: Wed, 26 Mar 2003 19:41:32 +1100 (EST) From: JeRRy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: re: multiple queries in PHP Hi, This is what I have so far. ? if ($REQUEST_METHOD == POST) { $usr = usr; $pwd = pwd; $db = db; $host = localhost; $cid = mysql_connect($host,$usr,$pwd); mysql_select_db($db); // NOTE that form fields automatically become variables $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner'; mysql_query($sql); echo(Points credited? I hope!brbr); } else {echo(An error occoured, please click back button and try again.);} ? Now is this right? ? if ($REQUEST_METHOD == POST) { $usr = usr; $pwd = pwd; $db = db; $host = localhost; $cid = mysql_connect($host,$usr,$pwd); mysql_select_db($db); // NOTE that form fields automatically become variables $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner'; if (match) { $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner': $sql = UPDATE profile SET update_table2; } mysql_query($sql); echo(Points credited? I hope!brbr); } else {echo(An error occoured, please click back button and try again.);} ? http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] re: multiple queries in PHP ????
ignore this, I no longer require assistance on the message below. l ATTACHMENT part 6 message/rfc822 Date: Wed, 26 Mar 2003 19:41:32 +1100 (EST) From: JeRRy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: re: multiple queries in PHP Hi, This is what I have so far. ? if ($REQUEST_METHOD == POST) { $usr = usr; $pwd = pwd; $db = db; $host = localhost; $cid = mysql_connect($host,$usr,$pwd); mysql_select_db($db); // NOTE that form fields automatically become variables $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner'; mysql_query($sql); echo(Points credited? I hope!brbr); } else {echo(An error occoured, please click back button and try again.);} ? Now is this right? ? if ($REQUEST_METHOD == POST) { $usr = usr; $pwd = pwd; $db = db; $host = localhost; $cid = mysql_connect($host,$usr,$pwd); mysql_select_db($db); // NOTE that form fields automatically become variables $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner'; if (match) { $sql = UPDATE round1 SET score=score+1 WHERE $select='$winner': $sql = UPDATE profile SET update_table2; } mysql_query($sql); echo(Points credited? I hope!brbr); } else {echo(An error occoured, please click back button and try again.);} ? http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Embedded Object Oriented Database System for PHP
I would like to announce embedded object oriented database for languages with dynamic type checking: DyBASE. Currently APIs for Python, Ruby and PHP are available. DyBASE is easy to use and provide high performance. It is intended to be used in applications which needs to deal with persistent data in more sophisticated way than load/store object tree provided by standard serialization mechanism. Although DyBASE is very simple, it provides fault tolerant support (ACID transactions) and concurrent access to the database. DyBASE is free and open source software distributed under MIT license. You can find more information about it and download this product at www.garret.ru/~knizhnik/dybase.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Design question...
Anyone have an links to websites that offer good tutorials on web design? I am most interested in learning about templates and how to design these for use with PHP pages. I am using DreamWeaver MX as a development environment and would really like some help with DreamWeaver templates if anyone knows of any. Any good book recommendations would be most appreciated too. Thanks, and sorry for the slightly off topic post. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] array manipulation with foreach
I am trying to make a bit of code that takes values from 2 arrays, one array has a list of all the date's of this week starting from sunday, $arraydate[$n] = the date where $n is an integer between 0+6 the other is a multidimensional array composition as such; $rota[$staffid][$x] = date staff member is working where staffid is a unique id number for each staff member. $x is just a number to denote the second array that stores all the days that staff are working. The output created by the code is as follows, it is not displaying all the days that every staff member is working... it should have staff member 1 working sunday and tuesday, and staff member 2 working monday and wednesday. == div align=centercentertable border=1 cellpadding=0 cellspacing=0 tr tdnbsp;/td tdSunday/td tdMonday/td tdTuesday/td tdWednesday/td tdThursday/td tdFriday/td tdSaturday/td /tr tr tdBar/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td /tr trtd2/td td/tdtd/tdtd/tdtdp align=centerinput type=checkbox checked name=C1 value=ON/p/tdtd/tdtd/tdtd/td /tr /table == here is the code i used ( i know it isn't right, but i just don't know how to fix it) == ? $weekbeginning = weekbeginningYmd(); $arraydate = createdatearray($weekbeginning); $rota = getrotafromdb($date); ? form method=POST pnbsp;/p div align=centercentertable border=1 cellpadding=0 cellspacing=0 tr tdnbsp;/td tdSunday/td tdMonday/td tdTuesday/td tdWednesday/td tdThursday/td tdFriday/td tdSaturday/td /tr tr tdBar/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td tdnbsp;/td /tr ? foreach($rota as $staffid = $variable){ ? trtd? echo $staffid; ?/td ? foreach($arraydate as $key = $date){ ?td? foreach($variable as $key2 = $workdate){ if($date == $workdate){ ?p align=centerinput type=checkbox checked name=C1 value=ON/p? } } ?/td? } } ? /tr /table /center/divpnbsp;/p /form _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: Empty display loop...
OK... I moved the form tag up before the table tag and added a tr tag to the beginning of the first line of display in the loop. No difference in the output. The first line of the output loop is still a completely empty line. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 6:30 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: Empty display loop... Scott V Nipp [EMAIL PROTECTED] wrote: I am working on a page that displays a line of information with a checkbox at the end. I began by getting all of the information I wanted displayed working properly and now I am adding the checkbox. Everything is going find with the exception that all of a sudden with the checkbox code in I am getting an empty line and checkbox at the beginning of the loop. I cannot figure out where this is coming from. Please let me know where I have gone wrong. Snipping a lot so you can see the problem: table width=90% bgcolor=#CC cellspacing=0 form method=post action=account_details.php /table /form Your nesting is bad. Put the form tag before the table. And you don't have a tr in your loop. Regards... Michael -- 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
[PHP-DB] wanted: example use of PHPv4 class DB
Hey, I'm developing a brand-new PHP application and want to use a generic interface instead of DBMS-specific function calls. Is the PHP v4 DB class what I should start with, and can anyone point me to a code example using it? Thanks! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] wanted: example use of PHPv4 class DB
Hey, I'm developing a brand-new PHP application and want to use a generic interface instead of DBMS-specific function calls. Is the PHP v4 DB class what I should start with, and can anyone point me to a code example using it? Which class are you talking about? You can use ODBC (not recommended) or the two most popular PHP-script database abstraction classes are PEAR:DB and ADOdb. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Generating view of tree?
I have a table with a tree. Thing is, I need to generate a view of it like: Category Sub-category Sub-sub-category Another sub-category Another category Sub-category Any way to do this, without using a huge number of queries? Using MySQL. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] example use of DB class
This has been answered 1000's of times. You could have had your answer in 10 seconds. http://www.google.com/search?hl=enlr=ie=ISO-8859-1q=php+pear+db+class+example olinux --- VaX#n8 [EMAIL PROTECTED] wrote: I think my last message failed to post properly. Can anyone show me an example use of the class DB, particularly for MySQL implementation? __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php