Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Okay, I got the beast to beast type (belongs to) part working again. I think it did have to do with the ids not being "id". This seems to have solved it. ADODB_Active_Record::TableKeyBelongsTo('beasts', 'beast_id', 'beast_types', 'beast_type_id', 'beast_type_id'); ADODB_Active_Record::ClassBelongsTo('Beast','Beast_Type','beast_type_id','beast_type_id'); The order seems to be important. Hopefully if anyone else runs into this trouble, this will help you solve it.
  2. Thanks! If it's working, don't forget to mark solved at the bottom.
  3. That doesn't sound like what the OP wants to DO though. "if the value of table's column 'automobiles' is equal to 0. Otherwise - print the real value." That refers to one column in the row. Not the whole row.
  4. Well, it looks like now the Beast_Type part isn't working either. So...something is wrong with these both.
  5. if $row == '0' {$row = $text_specified} Row won't equal 0. one of the values in row could be. row[0] might = 0, or row[1]. But row will never because of the while. You need to check on EACH column/key
  6. $_GET is the url. $_POST is a posted array from a form. If the form is set to post but you have info in the URL, to get that info you need to use $_GET. I only see $_POST in your code.
  7. So your WHERE clause would need to be limited by the rowID (which should probably be pageID if these are pages.) This can't be the same table though, because your previous post says INSERT INTO cms (pageTitle, pageText) where did pageTitle and pageText go?
  8. Also a good option - but what happens when the user enters an apostrophe? Aren't there a few other characters you can't use in keys? I think it'd be better in the long run to use a name you know will be the same every time.
  9. You'd need to give each a unique ID. You will probably need to clean up your database anyway. Post your table structure.
  10. Okay, so instead of using those names as the keys, use a different identifier. When you get the array of what names they want, that array should already have array_keys of 0-x. Use those instead of the names. Or prepend "question_" to the front.
  11. So each time they create a new attribute, you're saving it somehow, right? Into an array. So instead of trying to use the name as the key, just use the NUMBER as the key. Look I don't even know if this is the problem, but have you TRIED removing the spaces? Because I think it is. But I'm not going to keep trying to help you figure out a solution if you won't do a little debugging and see if removing the space works.
  12. Well, try not using those as the array keys, but rather an ID. Such as "question_1".
  13. Like how I posted above. I would recommend finding a good SQL tutorial if you don't yet know the difference between Insert and Update. I like TiZag's tutorials but I think phpfreaks has some good ones too still.
  14. $FirstName = $_POST['$FirstName']; Is wrong. $FirstName = $_POST['FirstName']; Would probably be closer to what you need.
  15. I think using spaces in an array key causes problems. Try Value_1 or value1 instead of having a space. Or just use the number and do a numbered array [1], [2] etc
  16. I only see you doing an Insert, no updates.
  17. Where are FirstName and LastName set? $name = $FirstName." ".$LastName; $header="From: $name <$mail_from>";
  18. I agree, but there are a few cases where I'd do it. Like with a DB object or something. It depends on the script.
  19. So...add the if statement... Where is the selected name coming from? The one you want to make already selected?
  20. read about "variable scope". You need to either pass the object into the function, or make it global.
  21. When you do an update, you can do UPDATE table(col1, col2, col5) VALUES(val1, val2, val5) WHERE [...] to skip some columns. Post your code!
  22. If you're not using HTML, AFAIK you can't do bold. You need HTML for that.
×
×
  • 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.