Jump to content

WendyLady

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Everything posted by WendyLady

  1. Did you figure this out?  Are you saving your dates in a MySQL table?  Could you create another column or table that tallies the number of appointments for each day, that updates itself as appointments are created?  Then have your little calendar pull its info from the secondary table for color & click-ability? Wendy
  2. Has this PHPfreaks tutorial been any help to you?  Actually, I would like to know since I'll be doing this before long: http://www.phpfreaks.com/tutorials/43/0.php
  3. I integrated PHPList (http://www.phplist.com) for someone -- and it allows this function.  It is free code, so you might take a look at how they handled it in their package.  (Sorry to not be of more help directly.) Wendy
  4. The only part of your code that is unfamiliar to me in syntax is: [quote]$queryexe = mysql_query($sql); while(mysql_fetch_row($queryexe))     {   $tema = mysql_result($queryexe, "tema");    $ritmo = mysql_result($queryexe, "ritmo");[/quote] I usually would write this for mysql_fetch_row: [quote]$queryexe = mysql_query($sql); while(list($tema, $ritmo) = mysql_fetch_row($result)) { echo '   <tr>   <td class="listas" bgcolor="#f7efde"> ' . $tema . '</td>   <td class="listas" bgcolor="#f7efde"> ' . $ritmo . '</td>   </tr>'; } [/quote] Maybe this will help?  I know it is irrational, but I always avoid escaping out of php in the middle of a query because it always seems to cause problems for me.  Mostly, though, try the while(list() syntax. Wendy
  5. Your question doesn't quite make sense, but [i]maybe[/i] I have an idea of what you are trying to say. Do you mean a code that will let them know they are still banned & for how many days, & will stay updated?  I designed an automatic member-management thing once, and I just put a simple code at the beginning of the home page, the admin index page, and the login page that ran through the members and changed a boolean flag for members whose expiration dates had passed -- so that you might actually block your own expired access just by trying to login.  Anyone who visited the site caused the updates to occur just by opening the page(s).  There is a name for this, "robot code" or "dummy code" or something, but I can't remember what it is -- but it works really well.  Would something like this work for updating number of banned days with your members? If that isn't what you mean, can you elaborate? Wendy
  6. Do you have a timeout for inactivity?
  7. Thanks so much!  I had to tweak it for my particular code, but the concept works beautifully! Thanks again -- Wendy
  8. Hi all -- I hope you are having a great weekend. If I have dates stored in a unix timestamp, is it possible to do a MySQL query that pulls all dates from a certain month?  Do I have to pull all the dates first & then specify the ones I want (seems resource-intensive)? Thanks so much! Wendy
  9. Sorry for long delay before adding update: I didn't get any of these to work, and finally decided to add a secondary step.  The user first sees a list of dates, then chooses one & a second query pulls everything for that date.  It is slightly more convoluted for the user, but it works well. Thanks everyone!
  10. I hope this is a simple question that I've just been sitting here too long writing code & my brain is fried. What I am basically trying to do is pull lists from MySql.  I have three tables.  One table is a list of possible dates, and the other two tables have various events, each one with a date that corresponds to one in the first table. What I want to be able to do is pull each date, then list below each one all the rows from the 2nd & 3rd tables that have that date.  There may be multiple dates, each one with multiple listings below it.  For some reason, I can't get my brain around how to echo this out logically. The logic flows as: --find all dates in table 1 that have boolean flag of "1" --go to table 2 and table 3 and find all events that have one of these dates --list each date with its corresponding events below I'm not looking for explicit code, but rather just some help with how to do this in code.  It seems like it should be simple, so it is making me feel really dumb, LOL.  Am I thinking about it too hard? Thanks! Wendy
  11. Hmmmm -- I'm surprised no one has said this before: A class definition can be used many times on a single page -- for example, a paragraph or a span can have the class [b].bold[/b] and this can be used throughout the page, many times.  It is typically a more general style. An ID definition is more restrictive, and each ID should only appear once on a page.  An example of this is #submenu --> or using the id="current" for navigation, to show which page a person is on.  There is only going to be one submenu on the page with this style, or only one tab can be "current".  If you use IDs multiple times, you can get interesting results in different browsers. Introduction to IDs vs. Classes: http://www.tizag.com/cssT/cssid.php Uses the id="current" for navigation (classic tutorial): http://alistapart.com/articles/slidingdoors/ Lots & Lots of General Help on CSS: http://www.w3.org/Style/CSS/learning
  12. Hi everyone -- I love this new layout! I'm on a new project with a sort of difficult person.  The page I'm building may be visited by someone with a Navajo language pack, and she wants to make sure it is accessible, so she is asking me to change all the fonts to Times New Roman "so that it will be compatible with Navajo". Okay, maybe [b]I'm[/b] the one who is ignorant, but this seems really ridiculous.  I do virtually all style from an external CSS file, so what difference does this make to a language pack?  Doesn't it read the fonts the same?  I'm doing some research, but can anyone enlighten me on this? Thanks, Wendy
  13. Hello -- Hopefully I can post this question here, as I don't know of a more appropriate place for it. I have just finished a project -- my first "paying gig" for a fairly complicated PHP/MySQL-driven site. It is a searchable database, where users can search & find contacts, customers can pay for a place in the database, register a new account, & login to modify their own information. There is a full admin side where the admin can manage the database & users. It includes automated processes for approving new accounts, suspending expired accounts, manually entering & editing & suspending accounts, etc. It is a setup for a business. The problem is, I'm not sure at all what is typical for rates & billable hours. I had in mind to bill for around 40 hours at $30/hour. It took me longer than 40 hours for sure, but it was a project that really pushed my skills & I had to do a lot of research & learning to get it done. It required 62 total PHP files, and I was figuring that even if I had been very experienced when I started, it would have taken me around an hour per file just to enter everything & debug. Is this typical? Am I way over- or under-charging? Thanks, Wendy
  14. Mags -- I hope you get a better answer than mine, because I can't think of how you can do this with straight PHP. I know it would be possible with Javascript, though. I have seen these before where it changes the second menu as soon as you select the first one, not with a submit button. With straight PHP & hitting a submit button, the only thing I could think of is to have Switch statements to move through or something, where once you hit submit, the previous selection grays out or becomes just text, and you would have links to go back & reenter a previous selection. But I'm not sure if that would work for what you're doing (does what I'm saying make sense?). Wendy
  15. Hello -- I'm working on an admin page that pulls values from MySQL into a pre-filled form, so that the administrator can make changes. Then when submitted, it updates the row in MySQL to be what is on the form. One of the fields is a category checkbox list that is populated by a request from another table (the admin sets the categories & can change them, and users can select the categories they fit in). To send this information to the database in a comma-separated string (so that it is in a text-searchable string for another part of the site), I have been using: $description = implode(',', $_POST['category']); when I call my variables. HOWEVER, I can't figure out how to repopulate the checkbox list as checked where the user had checked it, so I am just printing the string of current categories & would like for these to ONLY be changed if new checkboxes are checked. Otherwise, I want it to NOT change that entry. I've been trying this (and similar other things): if (isset($_POST['category']) && (strlen($_POST['category']) >= 1)) { $description = implode(',', $_POST['category']); } Also tried: if ($_POST['category'] != ""){ $description = implode(',', $_POST['category']); } but it keeps updating the field to empty if nothing is checked. I would appreciate your comments! Thanks, Wendy
  16. Um, [sheepishly] that worked great! For some reason I have recently had a mental lapse that causes me to think all the time I need a double-query when I [b]don't[/b]. The other day I did this & after I took a break & came back, I thought, "what am I doing?". I'm awfully tired of this project, but it has been invaluable for learning. Thank you! Wendy [!--quoteo(post=383838:date=Jun 14 2006, 08:57 AM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 14 2006, 08:57 AM) [snapback]383838[/snapback][/div][div class=\'quotemain\'][!--quotec--] could you do this however? $query = "UPDATE `user` SET `confirmed` = '2' WHERE `account_expire` < '$today'"; $result = mysql_query($query) or die (mysql_error ()); I didn't understand the reason for the first query [/quote]
  17. Hello -- First let me say that I've gotten a ton of help on here, & I really appreciate it! Especially how fast everyone is to respond. In response, I've been trying to help others as much as possible with my meager PHP skills, and plan to make a donation this week to help with server costs. Right now I'm working on a housekeeping function, to go at the beginning of my index pages, which would look through the user database, find all occurrences where the user's account_expiration_date has passed, and if it has, would change a boolean flag in another field to the value for account_is_expired. This prevents people from logging in whose accounts have expired, and flags them for the administrator to deal with. First of all, I'm not sure if I'm approaching this correctly, to put this in as a "housekeeping" function at the top of the user & admin index pages. Second, the code I've been using is simply changing ALL accounts to account_is_expired instead of only the expired ones. My first attempt was to select ALL users, then check all the account_expire fields, then try to return the expired ones (changed all users to expired there, too). It has been changing all morning, but my most current attempt is: [code] $today = time(); $query = "SELECT account_expire FROM user WHERE account_expire < $today"; $result = mysql_query($query); while (list($account_expire) = mysql_fetch_row($result))     {     $query = "UPDATE user SET confirmed = '2' WHERE ($account_expire < $today)";         $result = mysql_query($query);     } [/code] All of my stored times are php timestamps (which has been working best for me so far). Thanks so much for any help or advice! Wendy
  18. After working on this for ages, I decided that, at least for the simple needs of the database I'm building, php's time() function will work best. All I need to know is whether a date has passed (mark account as expired), OR whether the numbers of days until that date is <60 (mark account as expiring soon), and show number of days until expiration. I worked & worked & worked on the MySQL date & never could get it to work, but I had the time() working within a few minutes. Also, I had lots of trouble getting it to round up a date all the time -- if the number of returned days is 0.2, I want it to still round up to 1 until it hits zero. That was making me a bit crazed trying to write a ridiculous rounding-up formula until I found --TA-DA! -- the ceil() function. So now I'm off to re-edit my previously finalized code to use time() instead of MySQL DATE before I move on . . . Thank you! Wendy
  19. For checkmarks, it will submit the value=" " in your <input> area. If you have <input type="checkbox" value="male" name="gender" /> then it will try to submit "male" if that box is checked. Those should be char or varchar. Look up the definitions of what each type will hold. Try taking out your "insert" query for a moment & just ask it to echo back to you what was submitted in the form. When you can debug & get it to echo back properly, take out the echo & put your insert command back in. Wendy
  20. It sounds like you have a never-ending loop somewhere in your code. I did this once by mistake, and the results were very interesting. Sorry I can't remember what caused it -- maybe someone else can, or if you post the problematic code someone can help you out. Wendy
  21. Hey -- Another question for you. I'm building a database-driven site where I'm having to do a lot of date comparisons & subtracting dates to get number of days in between, and have so far been using the MySQL DATE functions. My dates are all stored as "2006-06-12" format. However, it is driving me bonkers, and it is giving me unreliable results. Would it make it simpler for me if I simply used the PHP date functions & translated it back & forth? I'm already having to use formatting functions every time I display a date, so it wouldn't create extra work there. Will I get better results if my dates are stored as "1150154710"? Another note -- I only need things to be as specific as number of days, not time or minutes or anything. Thanks! Wendy
  22. As far as I know, an animated gif looks the same as a non-animated one, file-wise. Can you add a little checkbox that says "Check here if animated" or something? Not sure what your purpose is, but I don't believe a section of code can figure out if a gif is animated or not.
  23. Hi -- I'm wondering about a clarification, because I can't find an answer. Basically, I'm trying to form a query that will look in the database, find all entries where the difference between a stored date & today is 0 (i.e., whether that date has passed). Another one, similarly, to find all entries where the difference between today & a stored date is <60. I'm playing around with the mysql DATEDIFF() function, but I can't even get it to tell me what the date difference was (not sure how to return it). And is it possible to have a query that says "SELECT * FROM xyz WHERE DATEDIFF('now()', 'stored_date')<60" ? It doesn't seem to be working, but I'm not sure if isn't just because I'm not doing it right. The mysql documentation isn't helping me all that much -- if there is another source, I would love to know about it. The point of my code will be to make changes to the entries where the stored date has passed, so would it be easiest to select all where stored_date < now()? I'm playing around with it in lieu of finding anything illuminating . . . Thanks -- Wendy --If I ever figure out dates, I'll be SET!
  24. For something similar, I have used the shell coding from BosDev. It wasn't expensive, and it cut out the hairy part of the programming so that I could just tweak it to be the way I wanted it. It isn't perfect, but it does the job & it is very easy to personalize. (Sometimes I cheat, but only if it is for something extremely complicated where I think someone else did a better job than I could on my own.) Wendy [a href=\"http://bosdev.com\" target=\"_blank\"]http://bosdev.com[/a]
  25. Well, shoot. I think I've been working on it too long. I just advised someone else to take a break, and now I think it is time for me to do so, too. LOL -- thank you! Wendy
×
×
  • 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.