Jump to content

RavenStar

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

RavenStar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That looks like something that might do what I need. Thanks a lot for that, I'll give it a shot. Much appreciated.
  2. Basically I'm trying to combine all these queries into one, somehow. SELECT * FROM dropbox WHERE type = '4' AND accounts.smoke = dropbox.value SELECT * FROM dropbox WHERE type = '5' AND accounts.drink = dropbox.value SELECT * FROM dropbox WHERE type = '6' AND accounts.drugs = dropbox.value SELECT * FROM dropbox WHERE type = '7' AND accounts.country = dropbox.value I tried to provide a list of my table in the link provided in my first post.
  3. ..No one has any ideas or input on this problem? As mentioned, I could just run individual queries but that's messy, I'm looking for a single query, if possible?
  4. Are you after just mysql or a webserver aswell? I suggest XAMPP, it's free and easy to setup. It includes a webserver, PHP, mysql, phpmyadmin and a few others. You simply start the launcher and pick which services to start, in your case.. webserver and mysql, that way you can use phpmyadmin to administer your databases. http://www.apachefriends.org/en/xampp.html
  5. Hi all. I'm working on a project in PHP that requires users to fill out a profile about themselves, though I've got a mind blank when it comes to making this query as short as possible. Basically I have 2 tables (accounts & dropbox). The users details are stored in the accounts table and the answers to some of the questions are just a value that matches up with a row found in the dropbox table. I need to return valueA of a cell in dropbox where valueB equals that of the value in accounts AND where valueC = '4'. (valueC defines the question we're looking up, so it will be different for each time we run through this query, it would be 4,5,6,7) This needs to be done for several different columns in the accounts table, is this possible to do with just a single query? I could go about doing this with several individual queries but that would be messy and it would haunt me. It's perhaps a little hard to explain without visualising it, so here's a link.. http://3es.com/RavenStar/table_structure.html Any help would be greatly appreciated, thanks in advance.
  6. Hi all~ I'm in the processing of constructing my own forum software in PHP but have hit a slight road bump with a sql query. I'm trying to come up with the most optimal way. Here is what I'm trying to do, The sql query needs to insert into 2 different tables, not the same data ofcourse. $w = numeric value "INSERT INTO threads ('parent', 'subject'.....etc) VALUES ('". $w ."', '" . $subject . "')"; $a = SHOULD equal the "id" column of the row we just inserted into threads(above). "INSERT INTO posts ('parent', 'name'.....etc) VALUES ('" . $a ."', '" . $name ."')"; So my question is, how would I go about getting $a? I know I could run the first query (insert into threads) then run a select query to find the id of the row we just inserted, and use that id to run the second query(insert into posts), however I'm wondering if there's a better/easier way? Sorry if this is a little confusing to read, I'm not sure how to explain it any easier Thanks in advanced~
  7. Thanks for the reply. I have thought about storing it in a database but decided against it for a few reasons. The reason I'm trying to do it the way I am, is so I can just have one copy of the core files under one account instead of having an account for each domain. In my example above, I am not sure if I'm using strpos correctly as it isn't working. Could some assist me in working out my above code to make it function? Thanks~
  8. I have several domains all parked on top of the main one, and I want the template of the site to be determined on which domain they go to. So if they goto www.site1.com it shows template A and if they goto site2.com it shows template B and so on. Here is what I have so far, which isn't working; $url = $_SERVER['HTTP_HOST']; if (strpos($url,"siteA.")) { $template = 1; $title = "Welcome to SiteA"; } else if (strpos($url,"siteB.")) { $template = 2; $title = "Welcome to SiteB~~"; } ..and so on, it goes for awhile. I know I should probably have the $template and $title in an array, but I don't know how to go about doing that. How can I achieve what I am trying to do? Thanks~
  9. Hi all. I got a fairly simple question, which I can't seem to work out after a few attempts at different approaches and searching the web. Basically I have an array which contains something along the lines of; <li class="cat-item cat-item-139"> <a href="blahblah.com">Title</a> at the start of every of every occurrence, though the number is always different. I want to remove the whole <li> tag, so I am only left with the <a> tag. How can I go about replacing/removing everything between point A and point B? Thank you in advanced.
  10. I know you wanted your forums tested, but I took a look at your site also full path disclosure http://www.toxicana.com/index.php?page=index Sorry ^.^
  11. That's the whole point Accounts are created by admins then mailed to the user.
  12. Ok will do, thanks for that. How did you come across those directories? Just guessed? Anything else I should fix? Thank you kindly~
  13. I'm working on a new site for some friends, and I just want to know if there is any security leaks. Please check if you are able to gain access to anything and report it here. http://carnagestk.info Much appreciated, thanks~
  14. Woohoo, it works. $query = "SELECT report.id AS 'ID', report.date_when, division.name, report.head_host, report.category "; $query .= "FROM report, division WHERE DATE(report.date_when) BETWEEN '{$start_date}' AND '{$end_date}' AND report.div_id = division.id ORDER BY report.date_when DESC"; I finally added the "AND report.div_id = division.id" and it all works fine, it display 1 of each result as it should with no problems as I can see so far(yet again, i am really tired =P) Thanks guys, you helped a lot!
  15. Thanks aschk, though it still isnt working. $query = "SELECT report.id AS 'ID', report.date_when, division.name, report.head_host, report.category "; $query .= "FROM report, division WHERE DATE(report.date_when) BETWEEN '{$start_date}' AND '{$end_date}' ORDER BY report.date_when DESC"; Output: (all with same id - 362) 2007-06-30 23:06:00 Bloodlust QuickSand 2007-06-30 23:06:00 TAG QuickSand 2007-06-30 23:06:00 Riches QuickSand 2007-06-30 23:06:00 Elixir QuickSand
×
×
  • 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.