Re: [PHP] problem connecting php and mysql
Hi, i'm not so good at running php on microsoft stuff, but it seems you dont have mysql support compiled in or not tuned php.ini properly. You can try php 4.3.11 zip package from http://php.net 'cause it said it has mysql support compiled in. Again, it's just a tip. Balazs Hegedus rahot man wrote: I have windows server 2003, PHPv5.0.3, Mysql v4.1 and IIS 6 and i am working in Macromedia Dreamweaver MX2004 i am unable to connect to the mysql server. but my php files are running fine and my mysql server is also running fine. i) i had changed the php.ini-dist file to php.ini. ii)i uncommented the extensions of php_mysql.dll in php.ini file iii)i set the extensions_dir to extension_dir = D:\PHP\php-5.0.3\ext\ in php.ini file iv)i had copied the libmysql.dll in windows\system32 and windows\system v)i also copied the php_mysql.dll to D:\PHP\ i wrote the following code: ?php $dbhost = localhost; $dbusername = root; $dbpassword = admin; $dbname = test; $connect = @mysql_connect ( $dbhost,$dbusername,$dbpassword ) or die (Could not connect .mysql_error()); mysql_select_db($dbname,$connect) or die(Could not select database.mysql_error()); ? but after all these i am still getting the error Fatal error: Call to undefined function mysql_connect() in D:\PHP\teknohub\new.php on line 14 please help me to solve this problem out -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource
Hi all, ever tried to test if your connection to the database succeeded? maybe that's why it shouted that ...not a valid result resource... msg. Balazs Hegedus Mark Sargent wrote: Drewcore wrote: just put a @ symbol before the function calll, eg while ($myrow = @mysql_fetch_row($result)) { etc On 4/25/05, Mark Sargent [EMAIL PROTECTED] wrote: Hi All, get the following error when calling data from mysql, *Warning*: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in */var/www/html/phpmysqltable.php* on line *36 * Below are snippets of my code, Line 22: $result = mysql_query(SELECT product_name, product_model_number, product_serial_number FROM Products,$db); Line 36: while ($myrow = mysql_fetch_row($result)) { printf(trtd%s %s/tdtd%s/tdtd%s %/td/tr\n, $myrow[1], $myrow[2], $myrow[3]); I'm following a webmonkey.com tut for php/mysql. http://webmonkey.wired.com/webmonkey/99/21/index3a.html Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi All, ok, that fixed the error message, thanx, but, no data is being displayed, only the table/row/cells. Database table, Products definitely has at least 1 entry in it. Cheers. Mark Sargent. printf(trtd%s %s/tdtd%s/tdtd%s/td/tr\n, $myrow[1], $myrow[2], $myrow[3]); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource
Hi again, just another tip...it's from the php man: *manmysql_query()* will also fail and return *FALSE* if the user does not have permission to access the table(s) referenced by the query./man Balazs Hegedus Mark Sargent wrote: Drewcore wrote: just put a @ symbol before the function calll, eg while ($myrow = @mysql_fetch_row($result)) { etc On 4/25/05, Mark Sargent [EMAIL PROTECTED] wrote: Hi All, get the following error when calling data from mysql, *Warning*: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in */var/www/html/phpmysqltable.php* on line *36 * Below are snippets of my code, Line 22: $result = mysql_query(SELECT product_name, product_model_number, product_serial_number FROM Products,$db); Line 36: while ($myrow = mysql_fetch_row($result)) { printf(trtd%s %s/tdtd%s/tdtd%s %/td/tr\n, $myrow[1], $myrow[2], $myrow[3]); I'm following a webmonkey.com tut for php/mysql. http://webmonkey.wired.com/webmonkey/99/21/index3a.html Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hi All, ok, that fixed the error message, thanx, but, no data is being displayed, only the table/row/cells. Database table, Products definitely has at least 1 entry in it. Cheers. Mark Sargent. printf(trtd%s %s/tdtd%s/tdtd%s/td/tr\n, $myrow[1], $myrow[2], $myrow[3]); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] radio buttons in $_POST
Hi, You solve the problem yourself: the radio input does show up once one of the radios is checked. When it is unchecked is isn't set...if you need to assign it a value in any circumstances you should test it with ?php $chkbox1 = (isset($_POST[radio_test])) ? true : false; ? for example (of course you may omit the ternary operator...isset() will do the same). Ashley M. Kirchner wrote: I have this form.html: form method=post action=form.php text input input type=text name=input_testbr / radio input1 input type=radio name=radio_test value=test1 / radio input2 input type=radio name=radio_test value=test2 / input type=submit value=Submit /form Then I have this script (form.php): ?php foreach ($_POST as $key = $val) echo $key = $val\n; ? If I simply submit the form empty, all I get back from the script is the text input $key. The radio button doesn't show up. Why is that and how can I have it show up? (the radio input does show up once one of the radios is checked, but I need it to show up when empty as well.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php