Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #2K
~15.0K People Reached
Favorite Forums
Favorite Tags
php x 13

10 Posted Topics

Member Avatar for j-e

<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 …

Member Avatar for codeintel
0
11K
Member Avatar for PomonaGrange

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 …

Member Avatar for theb3s7
0
143
Member Avatar for dottomm

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 …

Member Avatar for dottomm
0
148
Member Avatar for justinmyoung

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: …

Member Avatar for mcd
0
304
Member Avatar for mindfrost82

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]

Member Avatar for mindfrost82
0
2K
Member Avatar for skinbug

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, …

Member Avatar for skinbug
0
103
Member Avatar for justted

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 …

Member Avatar for justted
0
226
Member Avatar for AliHurworth

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 …

Member Avatar for AliHurworth
0
175
Member Avatar for Scooby08

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 …

Member Avatar for mcd
0
124
Member Avatar for justinmyoung

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 …

Member Avatar for mcd
0
106

The End.