Jump to content

jakeoh

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jakeoh's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks. However I am talking about a user selected "Rank" column or something similar, not the user ID.
  2. Hi, I am doing a simple CMS application for someone. On one page, the members of an association are listed. I want to give the CMS user the possibility to add and remove persons from the table, and to decide the order in which they are displayed (not alphabetically). Now my first idea is to create a "rank" column in the table, and then to order by this column when making the query. My question is: is it possible to have the user select the rank from a drop-down list, and then to update all other values in the column to a new value so that every rank is unique? For example, if the user selects "3" for "John Smith", then the current person with the "3" value will be bumped to 4, "4" bumped to 5, etc.? What would be the best way to achieve this? Thanks!
  3. I made small adjustments so that it fits my code but all is well now. Thanks a lot!
  4. Thanks Samshel, it worked perfectly. Now just another thing... how can I append the year in my table, for every year (March 2009, April 2009, etc., January 2010, February 2010, etc.) Thanks a lot, again.
  5. I understand your technique. However I'm not sure how to code it. How can the foreach start on the current month?
  6. I have an two-level array that contains, at the first level, a month of the year; the second level contains events held that month (name, description, start date, end date). I want to display this array in a table (events to come). The code I am using right now is this: <table class="calendrier"> <?php foreach($month_list as $month) { echo "<tr><td class='calendrier_mois' colspan='3'><h3>".$month['month_name']." </h3></td></tr>"; echo "<tr class='calendrier_head'>"; echo "<td class='calendrier_date'>Dates</td>"; echo "<td class='calendrier_even'>Événements</td>"; echo "<td class='calendrier_lieu'>Lieu</td>"; echo "</tr><tr>"; foreach($month['event_list'] as $event) { echo "<td class='calendrier_01'>".$event['event_startdate']."</td>"; echo "<td class='calendrier_02'>".$event['event_description']."</td>"; echo "<td class='calendrier_03'>".$event['event_location']."</td>"; echo "</tr>"; } } ?> </table> This is all fine, but I want to start with the current month; my array is ordered from January to December, so they are obviously ordered this way presently. How can I use PHP to start with the current month, and then cycle through the array and come back to January after December? Hope it's clear. Jake
  7. Hi, Thanks for your answer. I would obviously like to ignore IE6, but then again there are still too many (lazy) persons that use it, so I cannot just leave it that way. If someone can find a way to tweak the page so that it looks ok in IE6, I'll be delighted. What do you mean the log in doesn't work? It's currently being developed, so it's normal it's not really functional yet, but I am curious as to what you are referring to.
  8. Hi all, When I look at the following page: www.beta.mespetits.com The login bar underneath the navigation looks good in FF and IE7, but there is a problem for which I cannot find a solution in IE6. Does anyone has an idea what the problem may be? (Well the problem seems to be IE6, but is there a tweak to fix this?)
  9. 1) Thanks! 2) I have no problem doing that (one table per category) as one of my main goals is to practice designing databases... So using that solution, what tables would be required and which relation should be made? I guess I would create a Clothes table, that would relate to the Categories table through cat_id, and then in that table (Clothes) I would cover all possibilities (Women/Men/Unisex - different sizes)? But where is the specific information about, say, that specific Large sweater for Men is kept? In a new Category-Clothes table? 3) Great, thanks.
  10. Hi, I want to design a little classified ads website for fun. Now I am thinking at how my DB should be structured. So far I have this (I omitted certain fields that are not relevant for my question): Ad table ad_id ad_title ad_description ad_price ad_startdate ad_enddate Categories table cat_id cat_name cat_description Ad-Categories table ad_id cat_id User table user_id user_name ... Ad-User table ad_id user_id My questions are: 1. Does it seem like a good structure so far? It's my first time designing such a database, so I wouldn't know. 2. If a user posts an ad for the clothes category, he would have to select if the clothes are for men or women, and a specific size (say S, M, L, XL). Now where would that go in the database? In a new table? In the Ad table? In the Categories table? 3. What is the best datatype for the "Price" column? Is it decimal, or should I just use an integer and use php to deal with the decimals (for cents)? Thanks in advance!
  11. Sorry, I somehow thought timestamp was calculated in milliseconds. Using 604800 instead of 604800000 solved it.
  12. Hi, I want to have mySQL return users that went to my site in the last 7 days. When a user logs in or uses the website, the 'timestamp' column in the database is updated with the current timestamp. The MySQL query I have so far to get the list of active users in the past 7 days is as follows: $q = "SELECT username, first_name, last_name FROM ".TBL_USERS." WHERE timestamp > (UNIX_TIMESTAMP() - '604800000') ORDER BY timestamp DESC,username"; This query however get the users that were active more than 7 days ago. What is wrong with it? How would you build your query?
  13. Noob here, obviously. I have a database of users, each with an email address. I would like to get a string with every address followed by a comma. My SQL query will go "SELECT email FROM users", but how do I format the results so that I have a nice string with all addresses separated with a comma?
  14. I tried with the meta tags, but to no avail; it kept on displaying the ? in Firefox and the box in Explorer. However this solved the problem: setlocale(LC_ALL, 'fr_FR@euro'); $header = strftime('%B', mktime(0,0,0,$this->month,1,$this->year)).' '.$this->year; $header = htmlentities($header);
×
×
  • 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.