No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
10 Posted Topics
Re: <disclaimer>Just took a look at this post again, and I'm not entirely sure that a multiple select won't post as a CSV value by default, so that's worth a go, but if you want to get down and dirty with some javascript, read on...</disclaimer> Sure. You want to pass the … | |
Re: This would be a subquery in your larger query: [code] (SELECT CASE WHEN `office` = 'president' THEN 1 CASE WHEN `office` = 'vice-president' THEN 2 CASE WHEN `office` = 'secretary' THEN 3 # fill in the rest ELSE 4 END) as sort [/code] where sort is the alias we've created … | |
Re: try this (name the fields you want to select instead of using the star give you more versatility - like a sub-query): [code] SELECT s.story_id, s.user_id, s.storytitle, t.team_name (SELECT COUNT(c.story_id) FROM comments c WHERE c.story_id = s.story_id) AS comment_cnt FROM stories s INNER JOIN teams t ON s.user_id = t.team_id … | |
Re: Where to start... I assume that you mean this <a href="runners2.php"><?php echo $row['last_name']; ?> <small><?php echo $row['first_name']; ?></small></a> As the link you are clicking on? All that will do is try to run the page runners2.php. But you didn't pass any data to your script. This is not an error: … | |
Re: You need to change the mode to a or a+ [code=php] function writeFile() { $fp = fopen("feedback.csv","a"); //open the file for writing.. using a as mode so that the pointer is at the end of the file ... } [/code] | |
![]() | Re: Your HTML checkboxes need to have the same name, and a special syntax just for HTML arrays, as in checkboxes: [code=html] <input type="checkbox" name="cb[]" value="a" /> <input type="checkbox" name="cb[]" value="b" /> <input type="checkbox" name="cb[]" value="c" /> [/code] PHP will automatically receive this as an array. Assuming all checkboxes are checked, … ![]() |
Re: Easier: [code=php] $query="SELECT SUM(points) AS `total` from members2"; $result=mysql_query($query); while($row=mysql_fetch_assoc($result)) $total = $row['total']; [/code] If you want to limit the sum to certain sets of data, you will have to use the GROUP BY function in mysql. Learning about grouping and its associated functionality will help you avoid a lot … | |
Re: First let's dissect sql string you're trying to put togther: From what it looks like, you're passing $dir_search as the value being searched for, and $dir_type as the field to search on. Of course, with out seeing your table I'm really just guessing here. But if what I think you're … | |
Re: Well, the syntax to create unique keys in sql is: [code] ALTER TABLE `dw_order_items` ADD UNIQUE ( `item_id`, `order_item` ) [/code] This creates a UNIQUE restriction on the combination of those two fields. You can also restrict single fields. UNIQUE restrictions make sure that you never run into any problems … | |
Re: Actually, there is a better way to do this, which will give your users only one input to worry about, allow you the flexibility of keeping the first and last in separate fields, but still give the power of the search you are trying to do (or what i think … |
The End.