Jump to content

Chud37

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Everything posted by Chud37

  1. bump. BUMP BUMP BUMP.
  2. Hello, I have a form generated by mySQL and PHP, and inside the form (named 'UpdateDB') each line has checkboxes, like so: <input type="checkbox" name="checkbox[]" value="96" onclick="highlight(this,'check_96')"> The onclick is to highlight the row, that works fine. However, I wrote a javascript function that toggles the select all the checkboxes or none. This is done by an image: <img src="img/select.png" align="top"> <a href="#" onClick="togBox('updateDB');"><img src="img/all.png" name="listToggle" align="top"></a> Easy, right? So heres the Javascript function that the above image (the 'none' part) links to: function togBox(form) { var myForm = document.forms[form]; document.listToggle.src=='http://gospeltruth.tv/admin/img/all.png' ? toggle = true : toggle = false; (toggle) ? document.listToggle.src='img/none.png' : document.listToggle.src='img/all.png'; for( var i=0; i < myForm.length; i++ ) { (toggle) ? myForm.elements[i].checked = 'checked' : myForm.elements[i].checked = ''; } } Its a brilliant function if I do say so myself, and this is what I dont get: yesterday, it was working fine, today, its not working at all. The image changes, but IE flags up the 'myForm.length' as an error. How was it working 2 days ago and not today, when I havent touched it? Can anybody advise why its not currently working? Thanks for your help, ~Chud37
  3. This Is my SQL to retrieve info: SELECT pID, airdate, title, summary, duration, url, public, modTitle, Language FROM `Programs` JOIN Modules ON Programs.mID = Modules.ID JOIN Languages ON Programs.vID = Languages.ID ORDER BY title ASC; and the Modules and Languages tables simply have ID and then [modTitle] and [Language] fields. For some reason the above SQL statement was working, but isnt anymore. I dont know why this is. I hope t his explains it a bit better.
  4. No, okay, I dont want to Update, I was confusing English with SQL commands. I want to Insert new rows onto three tables at once, sort of.
  5. hello; I need to update a main table called 'programs' which is linked via two JOINS to a `Module` table and a `Language` table. Both the Language and the Module table have two columns, 'ID' and either 'Module' or 'Language'. I would like to be able to update all of these with a single SQL statement, however I am not able to get the INSERT to function on more than one table. So I am having to then update each table one by one. Which is problem no.1. if that isnt possible, then problem no.2. is looping through the data, and putting the information not only in the programs table, but into the Modules and Languages table to, and then keeping the two linking fields in `Programs` the same as the corresponding fields in both `Modules` and `Language`. i hope I have made myself clear. Does anyone have any solution to how I can code this, as i could really do with some help. Thanks, Chud37
  6. I looked up 'how to get all POST variables' and I ended up putting this bit of code together. Im not experienced at all with OOP programming, but I think that when '=>' is used its to do with OOP? Anyway. I dont get this code. I understand Foreach $_POST, as $someVar, (BTW im looking for checkboxes from a form), However, If I leave out the '=> $val' I simply get a lot of 'on' values, indicating the checkboxes I checked. However, WITH the '=> $val' I end up with the checkbox name. Now i've changed the name of '$val' so i know its not a keyword. But i dont get it. Is there a way to access the value of the checkbox? Can someone explain to me whats going on here? I know that I can get the value of the checkbox by $_POST['$checkRows'] But, I have a feeling It can be done in the foreach line. foreach($_POST as $checkRows => $hip) { echo "POSTED: $checkRows<br>\n"; } Please help!
  7. Hello, I want to return more than one row, but specific rows with my SQL query, So i figured i would try: SELECT * FROM database WHERE ID='2' AND ID='3'. But this doesnt work. Is there a way to get specific set rows returned? I might try: WHERE ID='2' AND WHERE ID='3'.. but im not sure. Thanks for any help. ~Chud37
  8. oh my. I searched around and did not find any answers on this, i cant believe it is as simple as that! but it works. Thanks! p.s - i suppose i can perform all the other operations and do some fun algebra in SQL queries? i.e. fld=((fld+1)*5)/4 ? Not that i want to in this point in time, but that would be legal, would it? Sorry for asking silly questions, like i said i couldnt find any documentation on it. Thanks, ~Chud37
  9. I am writing a poll script. I have an integer field in my DB, and i want to just open the DB, increment a value, and then display the results. Currently i've got three query's running; one to get the current data, one to UPDATE the current data, and one to display the changed data. This seems really rubbish to me. There must be a way to increment an INT field in a DB simply by using SQL. Can anyone help? I just need to plus one. I've looked around and i can't find anything on the subject, or maybe im just not searching the right thing. Anyway, please help. ~Chud37
×
×
  • 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.