Jump to content

theone

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Everything posted by theone

  1. [code]<? mysql_connect($db_host, $db_user, $db_pass); mysql_select_db($db_name); $sql = "SELECT * FROM news_site LEFT JOIN staff ON news_site.poster = staff.id WHERE news_site.show = '1' ORDER BY news_site.posted desc LIMIT 10"; $results = mysql_query($sql); $rowcount = mysql_num_rows($results); $i = "0"; while ($data = mysql_fetch_array($results)) {         $i++;     print "<u>$data[title]</u><br>";     print "$data[post]<br><br>";     print DateConvert($data['posted'], "l, jS F Y @ H:i:s");     if ($i != $rowcount) {         print "<hr noshade size=1 color=#3366cc>";     } else {         unset($i);     } } ?> [/code] So thats all good, but what i also want is to be able to fetch the staff.displayname for each news_site.poster, if that makes sense. Thanks in advance, Dave
  2. Thanks for the reply. It turned out if i put the variable user in quotes it works :-/ Thanks all the same.
  3. [code] <? mysql_connect($db_host, $db_user, $db_pass); mysql_select_db($db_name); $sql = "SELECT * FROM news_site LEFT JOIN staff ON news_site.poster = staff.id WHERE news_site.show = '1' ORDER BY news_site.posted desc LIMIT 10"; $results = mysql_query($sql); $rowcount = mysql_num_rows($results); $i = "0"; while ($data = mysql_fetch_array($results)) {         $i++;     print "<u>$data[title]</u><br>";     print "$data[post]<br><br>";     print DateConvert($data['posted'], "l, jS F Y @ H:i:s");     if ($i != $rowcount) {         print "<hr noshade size=1 color=#3366cc>";     } else {         unset($i);     } } ?> [/code] So thats all good, but what i also want is to be able to fetch the staff.displayname for each news_site.poster, if that makes sense. Thanks in advance, Dave
  4. The only way i can think of doing it would be to count the number of rows... etc. But is there a simpler way than that?
  5. Right... [code] <? mysql_connect($db_host, $db_user, $db_pass); mysql_select_db($db_name); $sql = "SELECT * FROM news_site WHERE `show` = '1'"; $results = mysql_query($sql); while ($data = mysql_fetch_array($results)) {     var_dump($data);         print "<hr>"; } ?> [/code] Now that will fetch small news articles from the database, like a blog style. What i want to do is on the last row it prints, i want to drop the print "<hr>". I cant do it based on a predifned number as the number of rows is not specified cos it depends on the number or news articles. How do i do that? Or isnt it possible? Thanks all, Dave
  6. theone

    Help

    well lets start with basic html. tahoma is not a font family its merely a font face. a family consists of more than one. but you need to be more specific as to what is not working or what errors its spitting out.
  7. [!--quoteo(post=362969:date=Apr 9 2006, 07:57 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Apr 9 2006, 07:57 AM) [snapback]362969[/snapback][/div][div class=\'quotemain\'][!--quotec--] Do you get any errors? The code looks ok. What are you expecting? Ken [/quote] Yeh. The error is: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in X:\www\thebestunsigned\v4\index.php on line 23 Thnx for the reply
  8. Hey guys. At the risk of sounding stupid, im still going to ask this... Why does this not work?... [code] <? mysql_connect($db_host, $db_user, $db_pass); mysql_select_db($db_name); $sql = "SELECT * FROM news_site WHERE show = '1'"; $results = mysql_query($sql); while ($data = mysql_fetch_array($results)) {     var_dump($data); } ?> [/code] I usually use the mysql_db_query function however i read at w3schools.com that that function is bein depreciated an that mysql_select_db and mysql_query should be used instead. But i cant seem to figure out why it isnt working :( Please help me... im a dumbass ,lol. Thanks in advance guys, Dave
  9. [!--quoteo(post=362682:date=Apr 7 2006, 06:20 PM:name=Yesideez)--][div class=\'quotetop\']QUOTE(Yesideez @ Apr 7 2006, 06:20 PM) [snapback]362682[/snapback][/div][div class=\'quotemain\'][!--quotec--] Its simple enough. [a href=\"http://hanna.pyxidis.org/tech/m3u.html\" target=\"_blank\"]m3u file format[/a] You're basically creating a text file. As long as you know what data you need to make it the rest shouldn't be too much of a problem. [/quote] So that seems fairly simple appart from one thing. how do i get the track length in seconds?
  10. Hi all. Heres a question im sure isnt common. How do i create .m3u files with php? Actually, first things first... is it possible? If it is, how do i do it, or, are there any good tutorials anywhere? Thanks in advance, Dave
  11. Wow... no replies. Thought this would be quite simple but i guess not :(
  12. Hi guys. Im making a little search script that searches the database. What i want to do is, where the search variable is found in the database cell, take like 10 words before it and 10 words after it to show in the results table. For example if a table row had... ********* Lore Epsom dolor sit met, consectetuer dehiscing elite, seed diem mommy nib episode incident at lacerate dolor magna alga at output. At wises denim ad minim venial, quiz nostrum exercise tuition ullamcorper susceptive laborites nil at Aliquippa ex ea commode [b]consequent[/b]. Dues tee feugifacilisi. Dues autism dolor in hindered in valuate veldt sees moles tie consequent, vela illume dolor eon feudist null facilities at Vero Eros et accusing et gusto olio diagnosis qui bandit present lutetium shrill delimit au glue dues dolor tee fugato null faceless. ********* ... in it, and i searched for "consequent", i would want to take the first 10 words before it and 10 words after to show in the results table if that makes sense. Thanks in advance. Dave
  13. Thanks for the reply. I decided to google it and came up with the one i knew but couldnt remember [code] <? var_dump($_POST); ?> [/code] Thanks anyways
  14. Hi Guys, I'm having problems with a script, so i want to know how to print everything that is posted from a form to a page, ie, in $_POST Thanks in advance, Dave
  15. Thanks for the reply. I already found out the smtp server address and sent myself a test email via my email client (thunderbird) about 10 mins ago and its yet to get back. As i said. Talktalk are poor. Does no one else know of a free, simple, windows smtp server? Thanks, Dave
  16. [!--quoteo(post=360472:date=Mar 31 2006, 03:42 PM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Mar 31 2006, 03:42 PM) [snapback]360472[/snapback][/div][div class=\'quotemain\'][!--quotec--] ????? Surely you service provider has one! I am with blueyonder so i can use smtp.blueyonder.co.uk. If you use outlook or similar you have to set an outgoing smtp server. [/quote] I'm with talktalk and they probably do have one but i can't be bothered to setup all that stuff. It probably requires a password knowing talktalk, lol. Is that how you do it then? What should i be looking for in my php.ini file then to set a smtp server other than the default localhost?
  17. Hi Guys. Not sure if this is where i should post it or under the servers section. The server section titles are all "webserver" thought an as this is a mail server then i figured not. I'm just wondering if anyone knows of a free, simple to use SMTP server that i can use for testing my scripts. I use my "localhost" for development however i can't test/develop any "mail" based scripts as i don't have a local smtp server. I'm sure someone will tell me that there is somewhere in the php.ini file where i can define an external SMTP server. I haven't looked for it myself thought as my email is with gmail and their SMTP is encrypted and requires a password an all that stuff. I just figured it'd be quicker and easier to have a local SMTP server. Thanks in advance guys, Dave P.S. Forgot to mention. It's for Win XP Pro
×
×
  • 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.