Jump to content
Larry Ullman's Book Forums

lutinFou

Members
  • Content Count

    13
  • Joined

  • Last visited

Everything posted by lutinFou

  1. Hi, whilts on the subject of foreign keys:I am currently working through the review and persue section of chapter 10, creating delete and edit scripts for the banking database. This database has foreign key constraints (ON DELETE NO ACTON). The database is made up of at least 2 tables (an accounts table [child] and the customers table [parent]) To delete a customer I first have to delete the child [account] that is clear. Question is, when writing my PHP script do I have to do this using 2 separate queries (i.e. DELETE FROM accounts WHERE customer_id=1 ...run that and then the same for
  2. hi, thanky you both very much for this. It goes a long way into helping me fully understand joins. thanks again LF
  3. OK....next question. I am struggling with INNER and OUTER JOINS. How would I write a query to tell me what member of staff speaks which langauge? So far I have come up with: SELECT s.first_name, s.last_name FROM staff AS s INNER JOIN staff_lang USING ( staff_id ); This will just link the "staff" table with the link table "staff_lang" containing the staff_id and lang_id foreign keys. Could anybody give me a tip on how to link the "lang"-->"staff_lang"<---"staff" tables to display the results? Sorry for posting such a basic question, but I am really struggling with this.
  4. Thanks Antonio. I thought I had it, but just wanted to check as I have checked several references for a normalization definition, but wasn't sure I had got it right.
  5. Hi, i have used the spam_scrubber function on a form in which I have included a drop down list and radio buttons. When I use the spam_scrubber function to validate the other text areas, that it works fine, however once I select something I get a the following warnning message: Warning: stripos() expects parameter 1 to be string, array given in file name on line 18. line 18 is : f(stripos($value, $v)!==false) ) However I think the error is generated from the line $scrubbed=array_map('spam_scrubber', $_POST); i.e. the $value has to be a string for the functi
  6. Hi Hartley San, thank you for your comments. It is good to bounce ideas off you experts to make sure that I am on the right track. Thanks you again! LutinFou
  7. Hi! This is not a question as such, I am mainly looking for somebody to tell me whether I am on the right track or way off the mark. I am currently working through the MySQL chapters, in particular Normalization. i just want to check if I have understood everything corrctly so far. Say I am creating a "language skills database" for an office, where all of the staff speak one or more foreign languages. Staff_id (PRIMARY KEY) first_name last_name email telephone number start_date language The way I understand normalization, I would need to first create table for the staff
  8. Hi all, many many thanks to all of you for your help. the "in_array" suggestion form Paul does the trick. In fact after re-reading the section on arrays last night, I realized that the $_POST['selService'] was an array value. I am just was not advanced enough in PHP to know how to to call (I do this all the time - get too far ahead of myself, although I guess that is the way to learn!) Now just got to wait for all the hair I have pulled out over this little problem to grow back hehehehe! Thanks again to you all Jonathan
  9. Hi, thanks for all of your help.I would never have figured out those bits of code myself. For some reason, the form is still not sticky. Guess I can live with out it for now ) thanks again! Jonathan
  10. Hi Jonathon, thanks for your help. I understand what you mean, I just seem to be having troble implementing it. I have changed the script somewhat to: echo '<select class="formInputText"name="selService[]"id="selService"multiple="multiple">'; $clientOption=$_POST['selService']; foreach($options as $service){ echo"<option value=\"$service\" if(isset($clientOption)&&($clientOption==$service))echo'selected=\"Selected\"';>$service</option>\n"; } however the line if(isset($clientOption)&&($clientOption==$service))echo'sel
  11. Hi, by using the code: //Array containing option values $options=array('Architecture','Interior Design','Dimensional Surveys','Party Wall Surveyors','In-house visualizations','CDM'); //Foreach loop to insert values into HTML echo'<select class="formInputText"name="selService[]"id="selService"multiple="multiple">'; foreach($options as $service){ echo"<option value=\"$service\" if(isset($_POST[$service])&&($_POST[$service]==$service))echo 'selected=\"Selected\"';>$service</option>\n"; } echo'</select>'; ?> Th
  12. Hi, first of all....this is a great book! Ok now to my question. I have created a HTML form in which there is a selection box generated by a php foreach loop: <?php //Array containing option values $options=array('Architecture','Interior Design','Dimensional Surveys','Party Wall Surveyors','In-house visualizations','CDM'); //Foreach loop to insert values into HTML echo'<select class="formInputText"name="selService[]"id="selService"multiple="multiple">'; foreach($options as $service){ echo"<option value=\"$service\">$service</option>\n"; } //close
  13. Just been reading your post. Re the text editor, I use Aptana Studio 3 (open source) it is great at spotting my typing errors
×
×
  • Create New...