[PHP-DB] newbie question: fetchrow or smth else ?
Could some one please check the following code and guesstimate where am I wrong ? (the only thing I got from browser is: Fatal error: Call to undefined function: fetchrow() pc_list.php on line 14, but on that line I have fetchRow() not fetchrow(). To make it worse even when I am replacing fetchRow() with FetchRow the same error is reported) PS. I used PEAR that comes with php-4.1.1 and php-4.0.4pl1. nothing changed :( --- require_once DB.php ; $db = DB::connect($db_type://$db_user:$db_pass@$db_host/$db_name, $db_pipe) ; $req = SELECT pc.hostname, m.logo, pc.mac, pc.ip FROM computer pc, mac m WHERE m.id = LEFT(pc.mac) ; $p_req = $db-prepare($req) ; $res = $db-execute($p_req) ; echo table border=1 \n ; echo tr th Hostname /th th Logo /th th MAC /th th IP /th /tr\n ; $counter = 0 ; while ( $arr=$res-fetchRow() ) { echo tr td $arr[0] /td td img src=\logos/$arr[1]\ /td ; echo td $arr[2] /td td $arr[3] /td /tr \n ; $counter++ ; } -- 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: newbie question: fetchrow or smth else ?
okay, thanks for help ;-p fetchrow failed because my query was buggy, the proper syntax for left is LEFT(something, number) Alecs [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Could some one please check the following code and guesstimate where am I wrong ? (the only thing I got from browser is: Fatal error: Call to undefined function: fetchrow() pc_list.php on line 14, but on that line I have fetchRow() not fetchrow(). To make it worse even when I am replacing fetchRow() with FetchRow the same error is reported) PS. I used PEAR that comes with php-4.1.1 and php-4.0.4pl1. nothing changed :( --- require_once DB.php ; $db = DB::connect($db_type://$db_user:$db_pass@$db_host/$db_name, $db_pipe) ; $req = SELECT pc.hostname, m.logo, pc.mac, pc.ip FROM computer pc, mac m WHERE m.id = LEFT(pc.mac) ; $p_req = $db-prepare($req) ; $res = $db-execute($p_req) ; echo table border=1 \n ; echo tr th Hostname /th th Logo /th th MAC /th th IP /th /tr\n ; $counter = 0 ; while ( $arr=$res-fetchRow() ) { echo tr td $arr[0] /td td img src=\logos/$arr[1]\ /td ; echo td $arr[2] /td td $arr[3] /td /tr \n ; $counter++ ; } -- 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: multiple forms, one submit button
I wonder how to you POST all forms with one submit (and without JS) ... Marius Ursache [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... hi is it posibile to have in a php script multiple forms and only one submit button? if yes, how you recover the submited data? ex: form method=POST action=$REQUEST_URI name=form1 bla bbla /form form method=POST action=$REQUEST_URI name=form2 bgf /form form method=POST action=$REQUEST_URI name=form3 gjhdf input type=submit name = test value = lala /form tnx -- Marius Ursache (3563 || 3494) \|/ \|/ @'/ ,. \`@ /_| \__/ |_\ \__U_/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php