[PHP-DB] Re: PHP help
$query=INSERT INTO login VALUES ('$login'); have fun Bill Pilgrim wrote: My System: Windows 98 Apache 1.3.27 PHP 4 mysql Hello all, I am a PHP beginner and was wondering if I could get some help from some of the more experienced on this list. I have been trying to use an html form (with textboxes, radio buttons, and textareas) to input data into a mysql database. I am able to connect fully with the database and am able to create tables in it, but when I try to input information into the tables nothing happens. ever... I don't really know what to do from here, but I assume that a configuration is not set properly between mysql, apache, windows, or php. I really don't know what it could be. My code is here and I have tried to simplify the form in order to get it working, so here is my barebones code that hopefully has some errors: HTML: html head titleSimplify/title /head body form action=addform.php method=post Login: input type=text name=login input type=submit /form /body /html PHP file called addform.php: ? $user=chris; $database=test; mysql_connect(localhost,$user); @mysql_select_db($database) or die(unable to select database); $query=INSERT INTO login VALUES ('$login'); mysql_query($query); mysql_close(); ? Login is the name of the table on the database named test. I stopped using a password because it wouldn't let anything work even table creation when I tried to use a password. Any help that anyone could give would be greatly appreciated; there is probably some grievious error in this script. Thanks, Chris - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: PHP help
snip PHP file called addform.php: ? $user=chris; $database=test; mysql_connect(localhost,$user); @mysql_select_db($database) or die(unable to select database); $query=INSERT INTO login VALUES ('$login'); mysql_query($query); mysql_close(); ? /snip Okay the line $query is wrong. So I quote... QUOTE $query=INSERT INTO login VALUES ('$login'); /QUOTE You have ('$login'); ... Why the before the '$login? It should be: $query=INSERT INTO login VALUES ('$login'); Goodluck! 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: PHP help
My System: Windows 98 Apache 1.3.27 PHP 4 mysql Hello all, I am a PHP beginner and was wondering if I could get some help from some of the more experienced on this list. I have been trying to use an html form (with textboxes, radio buttons, and textareas) to input data into a mysql database. I am able to connect fully with the database and am able to create tables in it, but when I try to input information into the tables nothing happens. ever... I don't really know what to do from here, but I assume that a configuration is not set properly between mysql, apache, windows, or php. I really don't know what it could be. My code is here and I have tried to simplify the form in order to get it working, so here is my barebones code that hopefully has some errors: HTML: html head titleSimplify/title /head body form action=addform.php method=post Login: input type=text name=login input type=submit /form /body /html PHP file called addform.php: ? $user=chris; $database=test; mysql_connect(localhost,$user); localhost should probably be $localhost OR'localhost'(?) @mysql_select_db($database) or die(unable to select database); $query=INSERT INTO login VALUES ('$login'); you can safely say - $query=INSERT INTO login VALUES ('$login') ; mysql_query($query); mysql_close(); ? Login is the name of the table on the database named test. I stopped using a password because it wouldn't let anything work even table creation when I tried to use a password. Any help that anyone could give would be greatly appreciated; there is probably some grievious error in this script. Thanks, Chris mentioning a password should do no harm. try $query=INSERT INTO login VALUES ('$login', password($password)); password() is a mysql function. its irreversible; somehting on the like that we have on LiNUX systems regards, -shiva -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] HELP PLEEASSSEE
I have a form like: select size=1 name=area . . while($row = mysql_fetch_array($result)) { ? option value=?=$row['area']??=$row['area']?/option ? . . 1- if the fetched is only one word, i have no problem BUT 2- When i have $row=['area'] ecual to happy day that came form MySQL (as two word with a space). 3- I have a problem when submit the form , if i echo $_POST['area'] in the action file .. i got only happy without day Please help me , because i m going to pull my hair off... Nabil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PHP help
Surely this will fail because $login has not been defined, by use of something like $login = $_REQUEST['login']; I tried the naked code as given, and (as expected) got an error - undefined variable - $login I was under the impression that had to be done for all 'incoming', if it was to be used for anything. Terry Riley --Original Message- $query=INSERT INTO login VALUES ('$login'); have fun Bill Pilgrim wrote: My System: Windows 98 Apache 1.3.27 PHP 4 mysql Hello all, I am a PHP beginner and was wondering if I could get some help from some of the more experienced on this list. I have been trying to use an html form (with textboxes, radio buttons, and textareas) to input data into a mysql database. I am able to connect fully with the database and am able to create tables in it, but when I try to input information into the tables nothing happens. ever... I don't really know what to do from here, but I assume that a configuration is not set properly between mysql, apache, windows, or php. I really don't know what it could be. My code is here and I have tried to simplify the form in order to get it working, so here is my barebones code that hopefully has some errors: HTML: html head titleSimplify/title /head body form action=addform.php method=post Login: input type=text name=login input type=submit /form /body /html PHP file called addform.php: ? $user=chris; $database=test; mysql_connect(localhost,$user); @mysql_select_db($database) or die(unable to select database); $query=INSERT INTO login VALUES ('$login'); mysql_query($query); mysql_close(); ? Login is the name of the table on the database named test. I stopped using a password because it wouldn't let anything work even table creation when I tried to use a password. Any help that anyone could give would be greatly appreciated; there is probably some grievious error in this script. Thanks, Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: PHP help
think you miss something try this : print_r($_POST); cause from a specific php version (above 4) al lthe form vars are in a special array called ($_POST) (when submitted by a form) so you should do: query=INSERT INTO login VALUES ('$_POST[login]'); I also removed a you got one to many hope this works! -mark- -Original Message- From: Shivanischal A [mailto:[EMAIL PROTECTED] Sent: maandag 30 juni 2003 13:13 To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: PHP help My System: Windows 98 Apache 1.3.27 PHP 4 mysql Hello all, I am a PHP beginner and was wondering if I could get some help from some of the more experienced on this list. I have been trying to use an html form (with textboxes, radio buttons, and textareas) to input data into a mysql database. I am able to connect fully with the database and am able to create tables in it, but when I try to input information into the tables nothing happens. ever... I don't really know what to do from here, but I assume that a configuration is not set properly between mysql, apache, windows, or php. I really don't know what it could be. My code is here and I have tried to simplify the form in order to get it working, so here is my barebones code that hopefully has some errors: HTML: html head titleSimplify/title /head body form action=addform.php method=post Login: input type=text name=login input type=submit /form /body /html PHP file called addform.php: ? $user=chris; $database=test; mysql_connect(localhost,$user); localhost should probably be $localhost OR'localhost'(?) @mysql_select_db($database) or die(unable to select database); $query=INSERT INTO login VALUES ('$login'); you can safely say - $query=INSERT INTO login VALUES ('$login') ; mysql_query($query); mysql_close(); ? Login is the name of the table on the database named test. I stopped using a password because it wouldn't let anything work even table creation when I tried to use a password. Any help that anyone could give would be greatly appreciated; there is probably some grievious error in this script. Thanks, Chris mentioning a password should do no harm. try $query=INSERT INTO login VALUES ('$login', password($password)); password() is a mysql function. its irreversible; somehting on the like that we have on LiNUX systems regards, -shiva -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: HELP PLEEASSSEE
select size=1 name=area . while($row = mysql_fetch_array($result)) { ? option value=?=$row['area']??=$row['area']?/option ? . --- USE QUOTES . while($row = mysql_fetch_array($result)) { ? option value=?=$row['area']??=$row['area']?/option ? } . -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ./configure stupidity
Hi, I wonder why at compile time ./configure doesn't automatically detect what features are compilable and what not, so as to build in php as much as possible. There isn't even such an option available, with the result that everytime I recompile PHP I end-up missing some group of functions that I didn't expect to need. Thanks, Nico -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] any ideas?
hello and thank you for your time... any ideas why this isn't working? thank you again. best regards, addison ? $query = select * from stores,subcategory,category where stores.category = $crow-id and subcategory.category = $crow-id and (stores.city = '$city' and stores.state = '$state') and que='checked' order by 'name'; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $count++; ? // url of site with problem: http://www.momandpopcentral.com - select a category(arts crafts) and state(TN) -next page enter city(nashville) there is a test store in the db that will not appear. -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 [EMAIL PROTECTED] [EMAIL PROTECTED] subsidiaries of small independent publishing co. [EMAIL PROTECTED] [EMAIL PROTECTED] addisonellis.com THIS E-MAIL AND ANY FILES TRANSMITTED WITH IT ARE CONFIDENTIAL AND ARE INTENDED SOLELY FOR THE INDIVIDUAL OR ENTITY TO WHOM THEY ARE ADDRESSED. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DO NOT READ, COPY OR RE-TRANSMIT THIS COMMUNICATION BUT DESTROY IT IMMEDIATELY. ANY UNAUTHORIZED DISSEMINATION, DISTRIBUTION OR COPYING OF THIS COMMUNICATION IS STRICTLY PROHIBITED. A
Re: [PHP-DB] setting session variables via a form
Not to beat a dead horse, but I have a problem associated with differences between 4.3 and 4.0.6. My local server (Mac OSX) is running 4.3 and has globals off. I designed the code to run with $_SESSION for my log in pages, and they work fine. Then I had to move the files to a client's server and discovered that he was running 4.0.6 and globals on. Now I have to revise my login scripts to accomodate. Is there a function like $_SESSION['user_name'] vs. $session_register('user_name') that would work on both? I tried $HTTP_SESSION_VARS[user_name] but that didn't keep the user_name going into the next page, which causes the login to fail and send back to the login page. Snippets as they are now (for 4.0.6): // this is the log in page ? session_start(); if ($user_name $login_pass) { // if the user has just tried to log in from FORM session_register(user_name); } if (session_is_registered(user_name)) { header(Location: content.php); exit(); } .. rest of file ? // content.php ? session_start(); if (!session_is_registered(user_name)) { header(Location: index.php); exit(); } die(check:.$user_name); -- may actually accept the registry of user_name but still does not display it .. rest of file ? On Monday, June 16, 2003, at 11:11 AM, Ford, Mike [LSS] wrote: -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED] Sent: 16 June 2003 17:08 session_start(); session_register(isRegistering); $_SESSION[isRegistering] = true; B't! If you're using the $_SESSION array, then you MUST NOT use session_register() and friends. (Well, ok, maybe that's overstating it a bit, but you still shouldn't do it!) Cheers! Mike
[PHP-DB] Obtaining mysql for php 4.1.2 on Linux
Hello, I'm trying to find the mysql.so module for php 4.1.2 on Linux. I don't know which version to use or if mysql is already embedded in the php build. Another option - how do I build php with mysql enabled? Thanks, Brian -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL error message...
Hello, Does anyone know what would cause this message? Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp\www\bod-rse\bod\menu.php3 on line 49... Here is the code: ? $command = SELECT * FROM central_fakepaths WHERE menu != '0' ORDER BY menu ASC; $result = mysql_query($command,$mysqlHandle); $path_directory=explode(/, $HTTP_SERVER_VARS[REQUEST_URI]); while ($myrow = mysql_fetch_row($result)) { $count++; If ($path_directory[1]==$devsite) { $path = $myrow[9]; $target = $myrow[10]; } else { $path = $myrow[7]; $target = $myrow[3]; } If ($myrow[5] != $count) { echo img src=\images/menu-line.gif\ width=\139\ height=\7\br\n; $count++; } // IF MENU VALUE == COMMITTEES if ($myrow[2] == Committees) { echo font face=Verdana size=1img src='images/menu-line.gif' width=139 height=7BR nbsp; a href='.' target='_top'Committees/aBR img src='images/menu-line.gif' width=139 height=7BR; $currdate = date(Y-m,time()); $cdate= explode(- , $currdate); $cyear= $cdate[0]; $cmonth = $cdate[1]; if ($cmonth =7 AND $cmonth =12) $fyear = $cyear + 1; else $fyear = $cyear; $fyear2 = $fyear - 1; $syear = $fyear2 - $fyear; $commandw = SELECT menuname, type, active, name FROM bod_board_boards WHERE type='committee' AND active='1' ORDER BY name ASC; $resultw = mysql_query($commandw,$mysqlHandle); while ($myroww = mysql_fetch_row($resultw)) { if ($myroww[0] !=) { echo nbsp; a href='committees.php?bord=$bordcomm=$myroww[3]' target='_top'$myroww[0]/aBR; } } //echo nbsp; a href='?bord=$bord' target='_top'What They Do/a; } else { echo nbsp; a href='$path' target='$target'$myrow[2]/abr\n; } } ? Any help would be unendingly appreciated... Keith -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL error message...
mysql knows. this means your query failed, $command resulted in an invalid result set. try adding: or die(mysql_error()); to any call to mysql_query ()so in your code use this: $result = mysql_query($command,$mysqlHandle) or die(mysql_error()); - and - $resultw = mysql_query($commandw,$mysqlHandle) or die(mysql_error()); that will give you all the info you need. hth jeff Keith Spiller [EMAIL PROTECTED]To: [EMAIL PROTECTED] ve.com cc: Keith Spiller [EMAIL PROTECTED] Subject: [PHP-DB] MySQL error message... 06/30/2003 12:47 PM Hello, Does anyone know what would cause this message? Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp\www\bod-rse\bod\menu.php3 on line 49... Here is the code: ? $command = SELECT * FROM central_fakepaths WHERE menu != '0' ORDER BY menu ASC; $result = mysql_query($command,$mysqlHandle); $path_directory=explode(/, $HTTP_SERVER_VARS[REQUEST_URI]); while ($myrow = mysql_fetch_row($result)) { $count++; If ($path_directory[1]==$devsite) { $path = $myrow[9]; $target = $myrow[10]; } else { $path = $myrow[7]; $target = $myrow[3]; } If ($myrow[5] != $count) { echo img src=\images/menu-line.gif\ width=\139\ height=\7\br\n; $count++; } // IF MENU VALUE == COMMITTEES if ($myrow[2] == Committees) { echo font face=Verdana size=1img src='images/menu-line.gif' width=139 height=7BR nbsp; a href='.' target='_top'Committees/aBR img src='images/menu-line.gif' width=139 height=7BR; $currdate = date(Y-m,time()); $cdate= explode(- , $currdate); $cyear= $cdate[0]; $cmonth = $cdate[1]; if ($cmonth =7 AND $cmonth =12) $fyear = $cyear + 1; else $fyear = $cyear; $fyear2 = $fyear - 1; $syear = $fyear2 - $fyear; $commandw = SELECT menuname, type, active, name FROM bod_board_boards WHERE type='committee' AND active='1' ORDER BY name ASC; $resultw = mysql_query($commandw,$mysqlHandle); while ($myroww = mysql_fetch_row($resultw)) { if ($myroww[0] !=) { echo nbsp; a href='committees.php?bord=$bordcomm=$myroww[3]' target='_top'$myroww[0]/aBR; } } //echo nbsp; a href='?bord=$bord' target='_top'What They Do/a; } else { echo nbsp; a href='$path' target='$target'$myrow[2]/abr\n; } } ? Any help would be unendingly appreciated... Keith -- 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] Re: connecting to mySQL - testing server specified does not map to the http://localhost/_MMServerScript/MMHTTPDB.php
I think de-installing mySQL and PHP might be a bit pre-mature, at least at this point. (This advise is from years of experience trouble shooting this stuff on my different systems. take it as it is given, freely and with a helpful hand. If anyone has issues with this procedure, please advise me with constructive criticism. I am always looking for a better way) First, check some things out as individuals... 1) can you connect to mySQL via the mySQL manager? - If so, then you are good there. - If not, then un-install and reinstall. - Make sure this works before you go on NOTE: I find unstalling and reinstalling a LOT faster than trying to track down issues on windows machines. Now, this is only a good idea IF you don't have any real databases running. IF you do, then you need to think hard about this and dedcide which would be easier; reinstalling and setting up your databses with the new installation or trying to find the problem. 2) does your Apache serve pages? - If so, then you are good there. - If not, then un-install and reinstall. - Make sure this works before you go on At this point, may I suggest my configuration. [NOTE: actually, delay this point until you verify PHP works] I added a 'conf.d' directory as a sibling to conf directory in my Apache directory. In there I have all my virtual domains defined (this may not apply to you.) BUT, I also have my PHP configuration definitions. I don't place this info in the main apache conf file. To much trouble editing that thing. I've placed my PHP.conf file at the end of this message. (And yes! I'm on a Win32 box! I'll leave it to you to see why I don't need a Volume letter! HINT: Apache, mySQL and PHP are NOT in C:\program Files\...) 3) does your PHP work from the command line? - If so, then you are good there. - If not, then un-install and reinstall. - Make sure this works before you go on NOTE: To install, my I suggest a new procedure. I know this works on NT and 2k, but I'm not sure about XP (I hope you'll let me know!) I have a virtual volume (I use G) labeled UNIX (the label is immaterial to the app, it's for me). On that volume I have etc. home, usr and tmp, just like my UNIX box. You don't need a virtual volume for this to work, just make these directories on any working volume you wish to use. I do this becasue I'm lazy about backups. With my method, I just backup the entire volume and all my apps and files are ready to be but back if (or I shoudl say when) I have to re-install windows. I have PHP installed at etc/php. I did this by hand. I did not use the installer. I dropped ALL the DLLs that the install manual said to place in the SYSTEM directory into that etc/php directory. Then I copied extensions and sapi in there as well. Then I rename and copied the PHP.exe that was in the CLI directory to php-cli.exe and placed it in the etc/php directory. This is the command line executable. In the php.ini I only had to change 3 lines... ; ; Paths and Directories ; ; include_path = .;G:\etc\php\extensions extension_dir = G:\etc\php\extensions and then uncomment this line... extension=php_gettext.dll Once this is all done, you will need to modify your PATH environmental variable. I have no idea where that is in XP, but you can find it. At the end of the existing string add... current PATH string;X:\path\to\your\php Now, X is your volume letter and the complete path to the php directory. Now, from a command prompt (DOS box) you should be able to key in php and key in any legal PHP command and get the proper response. And this is from ANY directory on your system. Now you can read the Apache conf directions above. Once that is done, create a test.php file and place it in your apache default directory and key this in to your browser. If all is right, you should get back your test page! If you have any questions, drop me a line. Hope this helps and not confuse. phpWalter # php.conf # Adding PHP integration # # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages. # # Un*x version # LoadModule php4_module modules/libphp4.so # Windows Win32 version LoadFile /etc/php/gnu_gettext.dll LoadModule php4_module /etc/php/sapi/php4apache2.dll Action application/x-httpd-php /etc/php/php.exe ScriptAlias /php/ /etc/php/ AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps # # Cause the PHP interpreter handle files with a .php extension. # Files *.php SetOutputFilter PHP SetInputFilter PHP LimitRequestBody 524288 /Files # # Add index.php to the list of files that will be served as directory # indexes. # DirectoryIndex index.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Oracle query returning values in sqlplus, but not php.
Hi all Here is a test version of my script. It queries the data dictionary view ALL_SOURCE. In sqlplus it returns all souce code in the database. In php it returns no rows. The only odd thing about it is that ALL_SOURCE.TYPE is VARCHAR2(12), and 'PACKAGE BODY' is twelve characters long. When I change 'PACKAGE BODY' to 'PACKAGE', it does return rows. ?php error_reporting(E_ALL); $oradb = OCILogon('','',''); $packageStmt = OCIParse($oradb, SELECT * FROM ALL_SOURCE WHERE TYPE = 'PACKAGE BODY'); OCIExecute($packageStmt); if(OCIFetchInto($packageStmt,$aLine,OCI_ASSOC)) { echo Cool Bananas\n; var_dump($aLine); } else { echo No Bananas\n; } OCILogoff($oradb); ? Im using PHP 4.3.2 Linked to Oracle 9.2.0.1.0 libraries connecting to oracle 9.2.0.1.0 database on another machine. Can someone confirm it is only me? Lang -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: any ideas?
hi, i can think of the following reasons: 1. if its ur query thats failing, then probably the 3 DB tables have columns with the same name. - and que='checked' order by 'name'; is this without conflict? 2. after ur while loop there is an opening curly brace and no matching closing one. are usure thats not the reason for ur failure? regards, -shiva Addison Ellis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hello and thank you for your time... any ideas why this isn't working? thank you again. best regards, addison ? $query = select * from stores,subcategory,category where stores.category = $crow-id and subcategory.category = $crow-id and (stores.city = '$city' and stores.state = '$state') and que='checked' order by 'name'; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $count++; ? // url of site with problem: http://www.momandpopcentral.com - select a category(arts crafts) and state(TN) -next page enter city(nashville) there is a test store in the db that will not appear. -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 [EMAIL PROTECTED] [EMAIL PROTECTED] subsidiaries of small independent publishing co. [EMAIL PROTECTED] [EMAIL PROTECTED] addisonellis.com THIS E-MAIL AND ANY FILES TRANSMITTED WITH IT ARE CONFIDENTIAL AND ARE INTENDED SOLELY FOR THE INDIVIDUAL OR ENTITY TO WHOM THEY ARE ADDRESSED. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DO NOT READ, COPY OR RE-TRANSMIT THIS COMMUNICATION BUT DESTROY IT IMMEDIATELY. ANY UNAUTHORIZED DISSEMINATION, DISTRIBUTION OR COPYING OF THIS COMMUNICATION IS STRICTLY PROHIBITED. A -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: MySQL error message...
hi, mysql_query($command,$mysqlHandle); should actually be mysql_query($command,$mysqlHandle); it works for me. i did not understand rest ur code. but i think should do it. try this and get back if still facing problems. regards, -shiva Keith Spiller [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, Does anyone know what would cause this message? Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp\www\bod-rse\bod\menu.php3 on line 49... Here is the code: ? $command = SELECT * FROM central_fakepaths WHERE menu != '0' ORDER BY menu ASC; $result = mysql_query($command,$mysqlHandle); $path_directory=explode(/, $HTTP_SERVER_VARS[REQUEST_URI]); while ($myrow = mysql_fetch_row($result)) { $count++; If ($path_directory[1]==$devsite) { $path = $myrow[9]; $target = $myrow[10]; } else { $path = $myrow[7]; $target = $myrow[3]; } If ($myrow[5] != $count) { echo img src=\images/menu-line.gif\ width=\139\ height=\7\br\n; $count++; } // IF MENU VALUE == COMMITTEES if ($myrow[2] == Committees) { echo font face=Verdana size=1img src='images/menu-line.gif' width=139 height=7BR nbsp; a href='.' target='_top'Committees/aBR img src='images/menu-line.gif' width=139 height=7BR; $currdate = date(Y-m,time()); $cdate= explode(- , $currdate); $cyear= $cdate[0]; $cmonth = $cdate[1]; if ($cmonth =7 AND $cmonth =12) $fyear = $cyear + 1; else $fyear = $cyear; $fyear2 = $fyear - 1; $syear = $fyear2 - $fyear; $commandw = SELECT menuname, type, active, name FROM bod_board_boards WHERE type='committee' AND active='1' ORDER BY name ASC; $resultw = mysql_query($commandw,$mysqlHandle); while ($myroww = mysql_fetch_row($resultw)) { if ($myroww[0] !=) { echo nbsp; a href='committees.php?bord=$bordcomm=$myroww[3]' target='_top'$myroww[0]/aBR; } } //echo nbsp; a href='?bord=$bord' target='_top'What They Do/a; } else { echo nbsp; a href='$path' target='$target'$myrow[2]/abr\n; } } ? Any help would be unendingly appreciated... Keith -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: PHP DB Interaction with Javascript?
Aaron Wolski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi All, Trying to get my head around something and want to know if it's possible first. Can PHP and Javascript interact to the point of PHP querying a DB to find out what records are in use as a variable for another record and then using JS to A) prevent the user from clicking a delete button; or B) pop-up a notice telling the user they can delete that particular record. Hope that makes sense.. any ideas? Sure it does! You looking to use PHP to query a database, create a table (or something) and give the user the ability to dealte [or not] a particular record from the displayed info. Snce you havn't told us how your displaying your data, nor how a user can kill a record, I will make some assumptions and you can go from there. I would display this info ina table stlye, rows and columns to dispaly the data from the database. Each row would have a checkbox on it so I can select several items at once and then have a DELETE button at the bottom and all the selected records will go away. Or you can place a DELETE button on EACH row to remove that particular record right then. Either way works. So now the question, how can server-side PHP tell client-side JS that this record can be modified and that record can not? Right? Simple, add a DISABLED attribute to the checkbox or individual record DELETE button (as descirbed above). If something in your record from the database says that this particular record can NOT be edited, then add the DISABLED aatribute to the Form Element (checkbox or button). And on the client-side, the HTML will take care of letting the user kill a record or not. Does this help? walter -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php