theone
Members-
Posts
17 -
Joined
-
Last visited
Never
Contact Methods
-
AIM
cook3cooke
-
MSN
cook3cooke@aol.com
-
ICQ
190407388
-
Yahoo
uk_theone_uk
Profile Information
-
Gender
Not Telling
theone's Achievements
Newbie (1/5)
0
Reputation
-
[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
-
Thanks for the reply. It turned out if i put the variable user in quotes it works :-/ Thanks all the same.
-
[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
-
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?
-
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
-
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.
-
[!--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
-
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
-
[!--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?
-
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
-
Wow... no replies. Thought this would be quite simple but i guess not :(
-
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
-
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
-
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
-
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