Jump to content

awjudd

Staff Alumni
  • Posts

    422
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by awjudd

  1. what 's wrong with the following code ? I declared the variables in the lines above this code.

     

    
    $connetion = mysql_connect($host $username $password)
    or die("connection could not be established"); 
    

     

     

    That is a syntax error ...

     

    It should be:

    $connetion = mysql_connect($host,$username,$password)
    or die("connection could not be established"); 

     

    Other than that we need more information about the error you are getting.

     

    @dougjohnson - you are missing a $ in front of password.

     

    ~juddster

  2. You are missing an ending " after your $q line.  As well as is $id numeric or a string?  If it is a string, then you need it in quotes ('').

     

    Otherwise we need more information about the error.

     

    ~juddster

  3. SELECT User, credits, links
    FROM table1 t1
    JOIN table2 t2 ON t1.User = t2.user
    WHERE t1.credits > 0

     

    ~juddster

     

     

    Column 'credits' in field list is ambiguous

     

    Not according to the table definition you provided us.

     

    Please do not skip small details when providing us information because it just makes the responses you get back not as useful as they can be.

     

    SELECT t1.User, t1.credits, t2.links
    FROM table1 t1
    JOIN table2 t2 ON t1.User = t2.user
    WHERE t1.credits > 0 

     

  4. If you look at it, after you select a value from the first drop down list and it auto posts back, the drop down list is back to 'Brand' which isn't correct.  As I mentioned you need to change the condition where you are marking it as selected to be based on the ID rather than the name because that is the value being returned.

     

    Because of this, you are seeing the issue you mentioned.

     

    ~juddster

  5. This is now because you are CROSS JOINing the results from all of your tables.

     

    If you cross join against 3 tables each with 10 rows you are getting 1000 rows in your result set.  So given each table is larger than 10 rows that is why it is taking forever to return.

     

    The LEFT JOINs all the way down except for against the KidsStudent table is the correct approach however, you just need to make sure your query is correct.

     

    ~juddster

  6. Your query is wrong ... using ' instead of `.

     

    $db="SELECT * FROM `$tble` WHERE `b1#` = '{$b1_num}' AND`c1#` = '{$c1_num}'" ;
    $db="SELECT * FROM `$tble` WHERE `a1#` = '{$a1_num}' AND `b1#` = '{$b1_num}'  AND  `c1#` = '{$c1_num}'" ;
    

     

    ~juddster

×
×
  • 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.