Jump to content

yrrahxob

Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by yrrahxob

  1. Thanks a lot.  That worked perfectly.  I really appreciate the help.
  2. I have a form that has three submit buttons and when I submit the form it goes through a validation routine to verify that all fields contain valid data.  What I want to do is bypass the validation routine if the user selects "Delete" or "Cancel" on the form.  Is there a way to get the value of the submit button in javascript?  Below is the code I have written but the alert I put in the script to show the value of the submit button is "Undefined".  Please help Thank you Harry Here is the form code: <form name=my_account action=index.php method=post onsubmit='return account_validate()'> Here is the submit button code: <tr> <td align='left' colspan='2'> <input type='submit' name='account_action' value='Update'>&nbsp;&nbsp;&nbsp; <input type='submit' name='account_action' value='Delete'>&nbsp;&nbsp;&nbsp; <input type='submit' name='account_action' value='Cancel'> </td> </tr> Here is the javascript function code: function account_validate() { var a_action = document.my_account.account_action.value; alert(a_action);
  3. I am building my own web site and on the main page, there is an option to login to a users' account if they so desire.  This is not a requirement.  After they login, they can browse through products and and then to the shopping cart.  When they are ready to checkout, they are presented with a form asking for name and address and other information.  What I want to do is when the form is presented and they are logged in, the form will be populated with the information retrieved when they logged in. below is the validation/login script I am working on.  I want to keep the values of the array $user_info during the entire session and I have register_globals disabled.  Someone please help. <?php function validate_user($user_email, $user_password){ $row=array(); $q = db_query("SELECT ss_first_name, ss_last_name, ss_email, ss_phone, ss_address_1, ss_address_2, ss_city, ss_state, ss_zip_1, ss_zip_2 FROM ".USER_TABLE." WHERE ss_email='$user_email' AND ss_password='$user_password'") or die (db_error()); $row = db_fetch_row($q); return $row; } if(isset($_POST["login_submitted"])){ $user_info=validate_user($_POST["user_email"], $_POST["user_password"]); } ?>
  4. I have the following query but it doesn\'t work. I get error code 1064. SELECT * FROM `aud_desc` order by substr(aud_code,1,1) Is it possible to do a select and order it by a substr of a column. Please help Thank you
  5. You might want to try this set_time_limit ( int seconds) Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini. If seconds is set to zero, no time limit is imposed.
  6. I wouldn\'t worry about it. Mysql automatically converts char to vchar if the field is over 3 or 4 bytes long. This is to save disk space for tables having an extremely large number of rows. Imagine a field that took up 500 bytes but only held 25 bytes of data but the table had 10 million records. lots of wasted space there.
  7. Error SQL-query : DROP TABLE MySQL said: #1064 - You have an error in your SQL syntax near \'\' at line 1
  8. I was writing a script that creates a temporary table based on a users login name. The first time I ran the script, the login name was not passed correctly to the next script and the query created a table with a NULL name. Now I get an error message when I use phpmyadmin to try to drop the table. Is there anyway of getting rid of this table short of exporting the data in every other table one at a time then dropping the entire database then recreating it and importing all the tables back to it. Someone pleeeeeeeze help. This is a very large database. Thank you. BTW. I am using phpmyadmin version 2.5.4
  9. Ok here is my problem. I have a query where I read a table T1 named MHI_ISSUES and 9 of the columns in the table contain a user id which can be from 1 to 3 digits. I also have another tabe T3 named MHI_USERS that I use to get the user name for each of the columns in the first table and then display them in a table on the screen. The headers on each of the columns is a link refreshing the page and sending a sort by number telling the query to sort by this column. When I do this, it sorts by the user_id number but I want it to sort by the user name. Does anyone know of a way to do this? I have my query shown below. Any help would be greatly appreciated. $qry=\"SELECT t1.issue_id, t1.issue_name, t2.status_desc, t1.user_id, t1.assigned_to, t1.assigned_to_orig, t1.modified_by, t1.interested_party1_id, t1.interested_party2_id, t1.interested_party3_id, t1.interested_party4_id, t1.interested_party5_id FROM mhi_issues AS t1, mhi_statuses AS t2, mhi_users AS t3 WHERE t1.status_id = t2.status_id AND ( t1.user_id = \'$user\' OR // $user is the 1 to 3 digit user_id number t1.assigned_to = \'$user\' OR t1.assigned_to_orig = \'$user\' OR t1.interested_party1_id = \'$user\' OR t1.interested_party2_id = \'$user\' OR t1.interested_party3_id = \'$user\' OR t1.interested_party4_id = \'$user\' OR t1.interested_party5_id = \'$user\' OR t1.modified_by = \'$user\') AND t3.user_name = \'$user_name\' // $user_name is the user_name field which I get when the page is loaded ORDER BY $sort_field LIMIT $seek_pos, $limit_return\";
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.