Jump to content

CodeToad

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling
  • Location
    FL & SC

CodeToad's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm trying to create a voting system so that users can rate an image on my site 1-5 and keep that info in the database but I'm stuck... I already have my image file names, descriptions, etc being pulled from a database, so I'd like (I think) to use a second database to keep track of the number of one's, two's, etc that have been assigned to the image's primary key. I have a database set up with: -image id (primary key) -number of votes (add 1 each time submitted) -average (recalculate each time submitted) -one (add one if user votes for this) -two (add one if user votes for this) -three (add one if user votes for this) -four (add one if user votes for this) -five (add one if user votes for this) Is this the right idea? The problem I'm running into is that I don't know how increase the value using "INSERT INTO" the correct column... Am I not going about this in the best way? ANY insight/help/suggestions/comments would be massively appreciated!
  2. Thanks for the quick responses guys! I had been google searching for a while with no luck. I figured it was just syntax issues, but I'm new to this and didn't know any better. You saved me a bunch of time, thanks again!
  3. Here is what I'm trying to do: $temp = 5; $sql = 'SELECT * FROM database WHERE numid = "$temp"'; It doesn't work since I'm trying to assign a variable inside a variable, does anyone have any suggestions?
  4. Thanks I'm new to databases but I'm familiar w/ VBa and VB.net, etc type programming. I was thinking I had to call all of the information in the database and then use an if statement to determine the most recent dates, then assign them to an array. Turns out there's a much easier way to do that as bg.anarchy showed me, and I had my dates wrong which andyb showed me I'll check out those tutorials and links, the book I have has been good so far but it's starting to wear a little thin and I am finding myself searching the net for more material, so thanks for the links!
  5. Thank you so much to both of you. You made a newbie's learning process much less painful! Honestly, thanks so much!
  6. I'm new to dynamic web design and am reading through David Power's book "PHP Solutions" so far so good. The project purpose is that ultimatley I'd like to have a single database that I can add image information (like discriptions, file name, date, etc) and then have my website pull from that. This database will get relativley large in terms of rows, 150+ and I want to be able to select and display the most recent 24 based on the date (integer 20070321 for example). I was thinking of ways to do this in general language, like an if statement to compare dates and assign the greatest 24 to an array, but this seems intensive. Is there a better way to do something like this or am I heading in the right direction? Would a conditional statement comparing each of the 150+ records make the page slow to load for the user?
×
×
  • 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.