Jump to content

Eiolon

Members
  • Posts

    358
  • Joined

  • Last visited

Everything posted by Eiolon

  1. Here is my table structure: CREATE TABLE `programs` ( `program_id` int(11) unsigned NOT NULL auto_increment, `program_name` varchar(100) NOT NULL, `program_date` datetime NOT NULL default '0000-00-00 00:00:00', `program_coordinator` varchar(100) default NULL, `program_description` text, `program_seats` tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (`program_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ; From my latest backup, the highest ID it got to was 43. For some reason it's started at 1. This is an internal use script for my work and no one here has access to the database.
  2. I have run into a small problem. For some reason, record id's are starting to be re-used in one of my applications. It's been working fine for several months. All of a sudden it has started at #1. I was under the assumption if a record id was deleted it would never be re-used (using auto_increment). Has this happened to anyone before? Is there anything that I can check for on the MySQL end to see if there is a problem? It's only happening to one table. Thanks.
  3. I am trying to get my subheader to line up directly beneath the icon. Here is how it currently looks: http://www.intravising.com/css.gif Thanks <div id="content"> <p class="icon"><img src="images/settings.png" /></p> <p class="header">Test Header</p> <p class="subheader">Test Subheader</p> </div> #content { padding: 20px; } #content .icon { float: left; } #content .header { margin-left: 10px; margin-top: 12px; float: left; font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: #339999; } #content .subheader { float: left; margin-top: 60px; font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: #990099; }
  4. On my front page, I link to articles. I want to use the beginning part of the article as the link but I need it to cut off after a certain amount of characters. It would then have ... that the visitor could click on to view the entire article. It's actually what PHPFreaks is doing on the main page of their new site. Thanks for your help.
  5. I noticed I forgot to create the container, which solves the problem.
  6. New to CSS so bear with me. I am trying to position my menu 5 pixels down from the top and 5 pixels from the left. Here is my code (which is probably totally off, mind you): html,body { background-color: #FFF; margin: 0px; } #navigation a { position: absolute: top: 5px; left: 5px; color: #FFF; background: #2C3B42; font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; text-decoration: none; padding: 5px; margin: 2px; } #navigation ul { list-style: none; } #navigation li { float: left; } The menu: <ul id="navigation"> <li><a href="#"><span>Home</span></a></li> <li><a href="#"><span>Finance</span></a></li> <li><a href="#"><span>Resources</span></a></li> <li><a href="#"><span>Contacts</span></a></li> </ul> The problem is each item is layered on top of each other. If I change the position to relative, it does not layer them but it does not position the menu 5px from the top and 5px from the left. Any suggestions? Thanks!
  7. Nothing is shown in the drop down menu when I use that code, probably because there is no result or row in your SQL statement.
  8. Here is what I use: <?php # mysql.php // Define the server and database variables. define ('DB_USER', ''); // MySQL username define ('DB_PASS', ''); // MySQL password define ('DB_HOST', 'localhost'); // MySQL hostname define ('DB_NAME', ''); // MySQL database // Establish the MySQL connection and then select the database. $dbc = mysql_connect (DB_HOST, DB_USER, DB_PASS) OR die ('Cannot connect to MySQL server.'); mysql_select_db (DB_NAME) OR die ('Cannot connect to database.'); ?>
  9. Are you looking to redirect your domain to your PC? So if you type mydomain.com it goes to your PC instead of your real web server? If so, that is possible. Look into dyndns.org.
  10. It gives me a list of the users except the first record in the table. I tried querying a different table and get the same result. Thanks for your help! $query_users = "SELECT id, username FROM users"; $users = mysql_query($query_users) OR die ('Cannot retrieve a list of users.'); $row_users = mysql_fetch_array($users); <select name="user"> <?php while($row_users = mysql_fetch_array($users)) { print '<option value="' . $row_users['id'] . '">' . $row_users['username'] . '</option>'; } ?> </select>
  11. Thank you. I always get mixed up on the single quote usage. I had mysql_real_escape_string() in there at first but took it out to troubleshoot to see if it was the problem.
  12. I am working on my first search engine so I made something small to test it. I created a table called "reservations" reservation_id int not null primary key auto_increment, reservation_date date not null default '0000-00-00' I inserted a date of 1981-09-01 for a test. On search.php I have: <form id="search" name="search" method="get" action="results.php"> <table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="50">Date:</td> <td><input type="text" name="reservation_date" id="reservation_date" /></td> </tr> <tr> <td width="50"> </td> <td><input type="submit" name="submit" id="submit" value="Search" /></td> </tr> </table> </form> On results.php I have: <?php if (isset($_GET['reservation_date'])) { require_once('../mysql_connect.php'); $query_reservations = "SELECT * FROM reservations WHERE reservation_date = ".$_GET['reservation_date'].""; $reservations = mysql_query($query_reservations) OR die ('Cannot retrieve date information.'); $row_reservations = mysql_fetch_array($reservations); $totalrows_reservations = mysql_num_rows($reservations); } ?> When I enter in the date of 1981-09-01 in the search box and submit, $totalrows_reservations is showing 0 instead of 1. It is getting the date because I echo it out with <?php echo $_GET['reservation_date'] ?> Any suggestions?
  13. YEARS id int not null primary key auto_increment, label varchar(25) not null, start_date date not null default '0000-00-00', end_date date not null default '0000-00-00', budget_amount decimal(10,2) ACCOUNTS id int not null primary key auto_increment, name varchar(100) not null, budget_amount decimal(10,2), year_id int not null default '0' year_id references id in YEARS table So when the year 2007 is selected it will list all accounts made for 2007.
  14. I'm looking for a solution that allows me to have two drop down menus. The first menu will select from a table called "years" and the second menu will select from a table called "accounts". If I select the year "2007" I want the second box to show all the accounts in 2007. If I select 2005, I want it to show only 2005 accounts, and so on... The tables have already been setup so the accounts reference the corresponding years. I am just looking for a javascript solution so it can be implemented. Thanks for your help!
  15. I know how to do basic MySQL and PHP and have a good idea on how to accomplish the task. I was really just looking for a tutorial so I could get some ideas for it.
  16. I am looking for a tutorial that allows me to create a logging system for my application. Basically, I want it to log what a paticular user does such as deleting something or making an edit, etc. Thanks!
  17. Let's say I want to have a maximum avatar dimensions of 100x100 pixels. That's easy to enforce by specifying the height and width in the image command. What would I need to do in order allow a 75x75 avatar be used by not be stretched to 100x100? Thanks! Currently, I am using: <img src="<?php echo $row_users['avatar'] ?>" height="100" width="100" />
  18. When someone makes a reply to a topic in my forum I have a session variable setup to direct them back to the topic after it's been submitted. I do this by using: if (isset($_GET['topic_id'])) { $_SESSION['topic_id'] = $_GET['topic_id']; } The problem I have is when I want to create a new topic rather than post a reply. The topic_id has not been created yet so therefore I can't set a session to it. I'd like to have the user taken to their topic after it's been created. Any ideas on how to accomplish this? Thanks!
  19. Ah, crap. I knew it was something simple.
  20. Lookup using LDAP with PHP. Also, are you using IIS? You can manage permissions for users/groups in IIS for folders and files.
  21. For some reason it is ordering alphabetically based on the name of the month not the actual date. I am using a MySQL datetime field. Query: // Query the database for participant information. $query_participants = "SELECT participant_id, participant_name, participant_phone, DATE_FORMAT(participant_added, '%M %e, %Y %l:%i %p') as convdate2, participant_age, participant_paid, participant_program FROM participants WHERE participant_program = ".$_GET['program_id']." ORDER BY convdate2 ASC"; $participants = mysql_query($query_participants) OR die ('Cannot retrieve participants.'); $row_participants = mysql_fetch_array($participants); Result: December 1, 2007 1:58 PM November 27, 2007 5:26 PM November 27, 2007 5:26 PM November 30, 2007 3:20 PM
  22. I can find the number of days between two dates, however, I want the actual dates listed instead. Any examples on how to do this? Let's say I want to fnd the dates between 2007-12-01 and 2007-12-05. The output would be: 2007-12-01 2007-12-02 2007-12-03 2007-12-04 2007-12-05 Thanks!
×
×
  • 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.