Jump to content

jlange

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by jlange

  1. the foreach is the best option still..i'm using simplepie (rss parser) and it does some weird OOP things (i think) which are way over my head. thanks for the reply, though, gives me exactly the answer I need.
  2. Maybe its something really simple, but I'd like to get a foreach going for items in an array, but I only want it happening a set number of times. I'm not really that much of an expert on loops (obviously), but I understand PHP, so go easy on me but not too easy!
  3. $stringpos = strpos($content, '.jpg'); $stringpos = $stringpos+4; $chars = $stringpos; $content = substr($content,0,$stringpos); $content = $content."\" style=\"height:100px\" /></a>"; works! thanks!
  4. ToonMariner: That gave me all of that extraneous text, and no image! i'll do some research on that function though, because to me it just looks like compiled C...
  5. by the way, i figured i can use a string search function to find a value from an array i'll make that will have all the different kinds of image file extensions, so, is there a string function to find what character number that is, or something? then, i could truncate it after that number of characters then just add on my string to the end.
  6. I'm not sure how to do this. What I'm trying to do is this: turn this: <a href="somelink"><img src="imgsrc" height="y" width="x">Some nonstatic text, courtesy of Flickr</a> into this: <a href="somelink"><img src="imgsrc" style="mystyle"></a> thoughts?
  7. Hi all, I'm not the best with JScript, and I've hit a roadblock in one of my projects because of it. I have a <select> with a lot of options, and another form with fields like username, password, first name, last name, etc. I would like those fields to fill with the information relating to whatever is selected in that <select> The data is generated via PHP from a MySQL database, if that serves any use. I look forward to hearing from you! This community is a great example of how the web lets people help one another and all that sappy stuff. PS, go easy on me, JScript to me is somewhat confusing, what with this.that.this(blah).that = this...PHP seems easier to me.
  8. Slightly off-topic: I have the id as the primary key. Is there a way to make new id's fill in the spaces caused by deleting old entries? It's just a temporary solution for now while I test out implementations, but I'd like to know.
  9. Hah, well, you lost me. But it's okay, I have something that works!
  10. Very cool. I think I'm going to take a simpler approach, and make a table for reservations that will have the date (m, d, and y) along with the id# of the object that's being reserved (referencing to another table), the id# of the faculty member who is checking it out, and finally the class period of the day for which its reserved. Making it time-based would be so much easier, but alas my school doesn't believe in making things easy. It's a work in progress and I'll update as I go along in case anyone wants to hear. I'm on Twitter; you'll probably find a lot of status updates going out today. (twitter.com/joey)
  11. Thanks much. I actually ended up SELECTing another value from the table (id). The list is being parsed for a <select> box that will then be submitted to remove whatever objects were selected. So, I have the id go to <select value="id"> and then I put the name column information betwixt the <select value="id"> and the </select>. I sort of feel like I'm actually coding useful things for the first time in my life.
  12. Hm, interesting. I had to nest a foreach in a foreach to get the contents of that array. It was like an array in an array or something. Strange. Thanks! I'll mark it as solved now.
  13. Aha. Thanks very much, that's a very good thing to know both now and for the future! I'm sure I'll be back with more questions before the end of the day!
  14. For some reason I can't get this to work; it ends up making an array of the one item in the first row. $query = "SELECT name FROM object"; $result = mysql_query($query) or die ( "Error in query: $query. " . mysql_error() ); $row = mysql_fetch_assoc($result); foreach($row as $value) { echo($value); } Thoughts?
  15. Alright, here's the setup: I'm writing a reservation system for my school's fleet of iBook (and now MacBook, but that's unimportant) carts. I have a user database all set up with id numbers and everything, so that's not an issue. What I need help with is developing a way to store the reservation data. The carts will need to be reserved for specific periods during a day, and will have to be able to be reserved for more than one timeslot, as you can book these carts up to two weeks in the future. I'm trying to think of a way to do this, but I'm drawing a blank. Can one put a whole PHP array in a single cell of a table? This is version 2.0 of the system; previously I was using a hierarchy of text files and folders to store the data (pain in the rear, if you ask me) Thanks much, jlange ps., go easy on me, I'm new to all this shiny MySQL stuff.
  16. Fixed For some reason or another, I had two columns set as keys, so I just made id the only key (makes sense to me).
  17. This might be it: the id column, I have set to auto-increment, isn't auto-incrementing.
  18. Hmm, now its telling me this: Error in query: UPDATE logon SET username='schmultz',password='math',firstname='John',lastname='Schmultzee',room='200' WHERE id = '1'. Duplicate entry 'schmultz-1' for key 1 Could be my poor table-setting-up skills. Any thoughts?
  19. I'm pretty much new to MySQL, but I understand the concepts (I think). I'm having issues with a MySQL query through PHP. $query= "UPDATE logon SET (username,password,firstname,lastname,room) = ('$username','$password','$firstname','$lastname','$room') WHERE id = '$id'"; That's the code. It tosses this error at me: UPDATE logon SET (username,password,firstname,lastname,room) = ('schmultz','math','John','Schmultzee','200') WHERE id = '1'. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(username,password,firstname,lastname,room) = ('schmultz','math','John','Schmult' at line 1 Help? edit: server version...oh shoot I don't know. It's their newest stable release.
  20. Actually, it only has to be 9 class periods out of the day, this is a school environment. I'm currently using a folder heirarchy using PHP includes and stuff. It works fine, but I would like to migrate to MySQL at one point or another. Thanks for all the input, fenway
  21. I'm relatively new to MySQL and the whole database-style of thinking..but I need a database that would contain the calendar, then a table for each day, then a cell for each hour, and another thing inside of that for each object (iBook cart, LCD Projector, etc) that is changeable from php on whether it is already signed out or not.
  22. Here's the rundown: I'm making a checkout system for my school for signing out iBook carts and computer labs, etc. I'm trying to figure out how to implement the calendar into a MySQL table. I need to have A) A daily calendar for each thing (eg, Cart A Cart B Cart C Lab A) B) Nine spots for information on the object, one for each period of the day. I've been racking my brain on how to do this, and I've come up blank. It just seems to me that the database structure doesn't go deep enough for the levels of information I'm trying to display. I'm using PHP and MySQL on Apache, generic installation on Mac OS X. Any help would be appreciated
×
×
  • 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.