Jump to content

ToniVR

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://users.pandora.be/Zero.Tolerance

Profile Information

  • Gender
    Not Telling
  • Location
    Belgium

ToniVR's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ToniVR

    login scripts

    Database: - tabel \'users\' - field \'username\' - field \'password\' Make a form where the users must provide their info. Check for existence in the db, if so, set the username in $_SESSION[\"username\"] and do a session_start(); The session_start() should occure on each page at the top. If not occuring in the db, you might ask for more info, or a retype of the password. Nothing much to do ;-) If you need sample-code, just ask. Grtz, Toni.
  2. I quickly jumped into my phpMyAdmin website and executed somthing like SELECT DISTINCT(manufacturer), register_size FROM processors and it gave me a perfect list of all manufacturers once, with the matching register-size. When the register-size has 2 values, it is returned twice (man-id the same, reg-id different). I think that\'s the solution.
  3. Well, multiple SQL queries only works if you know how much different names are in the database, which is quite a stupid solution. Possible solution (and I\'ll use just <div>\'s): $res = mysql_query("SELECT * FROM wheels WHERE brand=\'$brand\'"); $old_name = ""; $new_name = ""; echo "<div>title"; while ( $info = mysql_fetch_array($res) ) { $new_name = $info["name"]; if ( $old_name != $new_name ) { $old_name = $new_name; echo "</div><div>"; } echo $info["brand"]." : ".$info["name"]; # the line showing the wheel-info } echo "</div>"; This is off-course imperfect code, but I hope it makes the way of working a bit clearer. Grtz, Toni.[/code]
  4. ToniVR

    Small Problem

    What line number is given by the error? Are you using back-tics here? I would use: $sql_events = mysql_query("SELECT FROM r-setlist WHERE id=".$id); Works for me. Hope this helps a little bit. Grtz, Toni.
  5. The use of \'distinct\' is actually usefull when selecting a field from a table, but where that field can contain the same value over the entire table (not all field, but some). When using \'distinct\' in a \'select\', you will only get one result, instead of all matching results (assuming you only select 1 field off course). So in your example, the \'distinct\' applies to all field you request. In that way, you won\'t get duplicated results. If that is what you want: it\'s the correct syntax. For your second question, you can use different approaches. 1) Sort the result on the \'name\', and use a sort of $current_name ; $pervious_name mechanism in your code to separate the different \'names\'. 2) Use 2 SQL queries instead of one. 3) erm ... there are more, but I cannot get them out of my mind :wink: Hope this helps, Grtz, Toni.
  6. A quick search on Google, brought me to this URI: http://www.experts-exchange.com/Web/Web_La...Q_20361677.html It\'s an answerded question at Experts Exchange. And it works. Have fun! Toni.
×
×
  • 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.