User Profile
Collapse
-
You got a firewall it could be that stopping it? -
Personally i would create the field as varchar then you can check with a sql statement whats in the field and output the result.Leave a comment:
-
We need more information like whats the fields called and what your trying to do exactly?Leave a comment:
-
-
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
didn't work butCode:$sql = "SELECT userid FROM " .$table. " WHERE name = 'addon' AND ( (setting = 'day' AND value = '$day') OR (setting = 'month' AND value = '$month') );
...Code:$sql = "SELECT userid FROM " .$table. " WHERE name = 'addon' AND setting = 'day'
Leave a comment:
-
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)){Leave a comment:
-
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($rowLeave a comment:
-
...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 FROMLeave a comment:
-
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)...Leave a comment:
-
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'
Leave a comment:
-
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....Leave a comment:
-
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....Leave a comment:
-
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...
No activity results to display
Show More
Leave a comment: