Jump to content

Viper007Bond

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    Viper007Bond
  • MSN
    msn@viper007bond.com
  • Website URL
    http://www.viper007bond.com/
  • ICQ
    150093386
  • Yahoo
    Viper007Bonddotcom

Profile Information

  • Gender
    Not Telling
  • Location
    Portland, Oregon, USA

Viper007Bond's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay, I want to enter into a box some lines that will be stored in one cell. Anyway, when I press \"enter\" and make a new line in the box, I want those line breaks to be replaced with \"</li><li>\" so that I can do: <li>$text_from_database</li> and it\'ll make a list. Should I do this through some PHP method or should I have it enter it into the table and then run a SQL REPLACE command and replace... whatever line break is with </li><li>? Explain to me how to do what you suggest please. Thanks a bunch.
  2. Excuse me while I pound my head with a hammer. :roll: Thanks for the help guys.
  3. Nope. *EDIT* - I removed the quotes around the table name that weren\'t supposed to be there: [php:1:59f0ba3813]$query = mysql_query(\"SELECT * FROM $table_name WHERE show=\'fifth\' AND dateofshow=\'$date\'\") or die(mysql_error()); $result = mysql_fetch_array($query); echo $result[\'fileurl\'];[/php:1:59f0ba3813]
  4. I\'m still getting the same SQL error. Why can\'t I just get this to work?
  5. Nevermind. I get what you\'re saying. I can\'t compare text collumns. Gotta use varchar or char or whatever. Thanks.
  6. So how should I set up my database? I can\'t make sense of that link. :?
  7. [php:1:d83d06ade9]<?php // Input format: download.php?show=______&date=______ $hostname = \"localhost\"; $database = \"<database>\"; $username = \"<username>\"; $password = \"<password>\"; $table_name = \"geardownload\"; $connection = mysql_connect($hostname,$username,$password); mysql_select_db($database,$connection); if (isset($show) && isset($date)) { if ($show == \"fifthgear\") { echo \"You picked the show Fifth Gear and the episode from $date.<br />\"; $query = mysql_query(\"SELECT * FROM \'$table_name\' WHERE show=\'fifth\' AND date=\'$date\'\") or die(mysql_error()); $result = mysql_fetch_array($query); echo $result[\'url\']; } elseif ($show == \"topgear\") { echo \"You picked the show Top Gear and the episode from \".$date.\".<br />\"; } else { echo \"You picked an invalid show.<br />\"; echo \"<br />\"; echo \"<a href=\"http://5thgear.viper007bond.com/\">Return to the site.</a>\"; } } else { echo \"You must specify both a show and an episode date.<br />\"; echo \"<br />\"; echo \"<a href=\"http://5thgear.viper007bond.com/\">Return to the site</a> to get a valid link.\"; } ?>[/php:1:d83d06ade9] (No, I don\'t have \"&\" in my code, it\'s really \"&\".) http://test.viper007bond.com/download.php?...date=2003-11-16 :?
  8. I\'m new to MySQL and I frankly don\'t know how to do this. I need to get the value in the collumn \"url\" for the line where \"show\" is set to X and \"date\" is set to Y. I have this: [php:1:a38248ae1d]$query = mysql_query(\"SELECT * FROM $table_name WHERE show=\'fifth\' AND date=\'$date\'\"); $result = mysql_fetch_array($query); echo $result;[/php:1:a38248ae1d] but no luck. A little help please? Thanks a ton.
×
×
  • 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.