Jump to content

Mutley

Members
  • Posts

    765
  • Joined

  • Last visited

Everything posted by Mutley

  1. I have 2 tables, one with these fields: (Table name: loadout) user_id | prod_it Then the other with: (Table name: products) prod_id | name | description What I want to do is list all the products names for a user. The user table only has the prod_id in it, not the name, so how do I simply take the name from the other table? At the moment I do a SELECT query to get the prod_id from the user, then do an individual SELECT query for every single product name using the prod_id I got earlier, as you can imagine, it's a lot of code this way!
  2. Mutley

    And/Or

    I know in PHP, that "or" is: || Then "and" is: && How do I do and, and or? Or should "||" do the exact same thing on its own?
  3. Ah, sorry, should of added. For each there will be a different WHERE clause.
  4. I have 2 tables and want 1 query to select 1 field from table_a and 2 fields from table_b then display them using: while($row = mysql_fetch_array( $result )) { echo $row['field1_table_a'], $row['field2_table_b'], $row['field3_table_b']; } ...any assistance would be great.
  5. Thanks, got it working, I want to take it one step further now. If I go to a different page, where it has another list and tick some more how can I make it remember the ones I ticked on the previous page? So when I compile a new page with only the ones ticked, it shows from both pages and not just one?
  6. If a form isn't filled in, when they click the Submit button how do I create a System message style box to notify them?
  7. Woah, easiest PHP yet, thanks. Worked straight away.
  8. I have a form that uploads an image, that I want to rename the image to the next auto_increment number that is in a field (id) of a row. How do I do this? I was trying to SELECT the last "id" and add 1 but obviously if I deleted a row, then went to add another picture, it would be 1 behind/incorrect.
  9. Worked a treat. How do I use that to pull more fields out of the same IDs row? Do I do a SQL query or can I take it off the page POST using the checkbox like it did with the ID? Thanks!
  10. My form is like this: {All the items variables to display} <input type="checkbox" name="order" value="<?=$id?>" /> Then when they click submit it goes to newdisplay.php In which that file grabs the $id of all the items chosen. So, I know how I display the items information using the $id, just don't know how "newdisplay.php" knows all the $id's ? How do I carry them across?
  11. With some of my forms, it says that </form> is not needed and invalid, I've not duplicated it, I'm wondering why it is saying this?
  12. I have a list and what I would like to do with this list is have a tick-box next to each one, so someone can select multiple things out of the list. Then, once they click "submit", it displays just the things they selected. The list in the data is displayed from a database by repeating the rows, so if there are 3 rows, it displays it in a table repeating the <tr><td><?=$thing?></td></tr> until it ends. I know how to do forms, just not how to post only the selected data, to display it on a different page. Thanks.
  13. The <marquee> tag isn't approved by HTML standard validation. Plus it isn't really advanced (rollover and scrolling of content pauses). I don't know Javascript but I do know it can produce marquee effects, I would like it short and simple, can anyone help me out? Thanks.
  14. I looked in the login.php and not sure what I'm looking for, this seems close though, maybe it makes more sense to you: if (!verify_authentication($vbulletin->GPC['vb_login_username'], $vbulletin->GPC['vb_login_password'], $vbulletin->GPC['vb_login_md5password'], $vbulletin->GPC['vb_login_md5password_utf'], $vbulletin->GPC['cookieuser'], true))
  15. I put it at the bottom of index.php and viewpost.php and it shows nothing.
  16. I get: Array() That's it.
  17. How are sessions stored? In the database or in a cookie?
  18. The: print_r($_SESSION); Comes up blank?
  19. Can you go into a big more detail? So do I not use cookies at all? Thanks.
  20. I'm trying to make a simple script where if you are logged in on the Vbulletin forum, you can view pages on the website (seperate to the forum). I matched the ID cookie with the one in the database but when I tried the Password cookie, it's completely different to the one in the database. I'm sure the database stores it in MD5 but no idea about the cookie? Any ideas?
  21. I'm not doing seperate tables though, I don't see the point it means duplicating the product information like price and name ?
  22. Sorry, bit of a brain fart. The database has a table called "products" with fields such as: id | number | name | description | descriptiong | descriptionf (descriptiong = german, descriptionf = french ) The language isn't needed to be change else where but, if I wanted a certain page to change as well, that would be helpful, I imagine the session would be easy like variables where it would change what is called?
  23. I've got 3 languages for products on a site in a database (English, German, French). English is the default language. I was considering using variables so when they click say the French flag, it pulls the french language out of the database for that product but this started to get messy. Should I use Cookies or Sessions, how would you do it?
  24. Mutley

    Problem

    DELETE * FROM ipb_tablesmembers AS mem JOIN ipb_tablespfields_content AS fld ON mem.name = fld.field_1 WHERE posts < '1' AND time_offset = '-12' You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM ipb_tablesmembers AS mem JOIN ipb_tablespfields_content AS fld ON mem.n' at line 1 Any ideas?
  25. Hi, Trying to write a script, when someone adds a product to the database it automatically puts the date into a field in the database (DATE 0000-00-00) of the current date. What I want to do is IF the product was submitted within the last 2 weeks to display an image. A "new product" style image. If it's older don't display anything. How would I do this?
×
×
  • 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.