User Profile

Collapse

Profile Sidebar

Collapse
acoolguy
acoolguy
Last Activity: Jul 24 '10, 07:51 AM
Joined: Jul 6 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • You got a firewall it could be that stopping it?
    See more | Go to post

    Leave a comment:


  • Personally i would create the field as varchar then you can check with a sql statement whats in the field and output the result.
    See more | Go to post

    Leave a comment:


  • We need more information like whats the fields called and what your trying to do exactly?
    See more | Go to post

    Leave a comment:


  • acoolguy
    replied to Using mysql in php
    Thanks again :)
    See more | Go to post

    Leave a comment:


  • acoolguy
    replied to Using mysql in php
    Thanks a million i thought it might have been the database structure and that i would have to reorganize it in a better way however
    Code:
    $sql = "SELECT userid FROM " .$table. " WHERE name = 'addon' AND ( (setting = 'day' AND value = '$day') OR (setting = 'month' AND value = '$month') );
    didn't work but
    Code:
    $sql = "SELECT userid FROM " .$table. " WHERE name = 'addon' AND setting = 'day'
    ...
    See more | Go to post

    Leave a comment:


  • acoolguy
    replied to Using mysql in php
    Thanks for all the help so far however after trying the code like this ...
    Code:
    $day = date("j");
    $month = date("n");
    $sql = "SELECT userid FROM " .$table. " WHERE name =  'addon' AND setting = 'day' AND value = '$day' UNION SELECT userid FROM " .$table. " WHERE name =  'addon' AND setting = 'month' AND value = '$month'";
    $result = db_query($sql);
    while($row = db_fetch_assoc($result)){
    ...
    See more | Go to post

    Leave a comment:


  • acoolguy
    replied to Using mysql in php
    Ok after a little rewrite i have this

    Code:
    $day = date("j");
    $month = date("n");
    $sql = "SELECT userid FROM " .$table. " WHERE name =  'addon' AND setting = 'day' AND value = '$day' UNION SELECT userid FROM " .$table. " WHERE name =  'addon' AND setting = 'month' AND value = '$month'";
    $result = db_query($sql);
    $row = db_fetch_assoc($result);
    foreach($row
    ...
    See more | Go to post

    Leave a comment:


  • acoolguy
    replied to Using mysql in php
    Code:
    $table = db_prefix("names");
            if (get_module_setting("allowindex","birthdayscroll") == '1'){ //check if allowed to show on index page
    	    $day = date("j");
            $month = date("m");
            $sql = "SELECT userid FROM " .$table. " WHERE modulename = 'addon' AND setting = 'day' AND value = '$day'";
            $sql1 = "SELECT userid FROM
    ...
    See more | Go to post

    Leave a comment:


  • acoolguy
    replied to Using mysql in php
    I have tried them both ways in both the phpmyadmin sql section and in the php file and both ways is the same result which is
    phpmyadim sql section result 4
    php file result 1
    its a real mystery to me i have tried a load of different ways and they all produce the same results in phpmyadmin sql section the result is 4 (correct)
    php file the result =1 (wrong)...
    See more | Go to post

    Leave a comment:


  • acoolguy
    replied to Using mysql in php
    Update:

    After going to the phpmyadmin and running the follow code in the sql section i get the result of 4 however using the same code in php i get 1 result ?

    Code:
    SELECT userid
    FROM `tablename`
    WHERE name = 'addon'
    AND setting = 'day'
    AND value = '7'
    UNION SELECT userid
    FROM `tablename`
    WHERE name = 'addon'
    AND setting = 'month'
    AND value = '7'
    ...
    See more | Go to post

    Leave a comment:


  • acoolguy
    replied to Using mysql in php
    Thanks for the reply however using the 2 sql statements it only shows 1 result yet i know there are more than 1 as i checked the database myself :(
    I use db_num_rows($ro w) to get the number of rows thats returned from the query and it shows only 1 result yet there are more than 1....
    See more | Go to post

    Leave a comment:


  • acoolguy
    replied to Using mysql in php
    Well thats just it the above code sort of works but it only picks one when there are more than one that meet the the search....
    See more | Go to post

    Leave a comment:


  • acoolguy
    started a topic Using mysql in php

    Using mysql in php

    My table is set up like this

    Field Type
    name varchar(50)
    setting varchar(50)
    userid int(11)
    value text

    Now im trying to get the userid from the database where the name = name and setting = month the value = 6 and the setting = day and the value = 7

    in the field "setting" there are various data name 2 of them are called day and month and basically im trying to...
    See more | Go to post
No activity results to display
Show More
Working...