Current location: Hot Scripts Forums » Programming Languages » PHP » news thing not working


news thing not working

Reply
  #1 (permalink)  
Old 10-11-04, 04:04 PM
4n7hr4x 4n7hr4x is offline
Banned
 
Join Date: Jun 2004
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
news thing not working

ok, i use php quite frequently, and i have done many news scripts, and today i did another one, i used the code i use almost every time, here it is:
PHP Code:

<?php

    
    
require ('config.php');
    
    
$query "SELECT * FROM th_news";
    
$result = @mysql_query ($query);
    while (
$row mysql_fetch_array($resultMYSQL_NUM)) {
    
    
$date $row[4];
    
$date substr_replace($date''10);
    
    if (
$result) {
        echo 
'<table width="581" border="0" cellpadding="0" cellspacing="0" align="left">';
        echo 
'<tr><td>';
        echo 
'<b><u>' $row[2] . '</u></b><br></td></tr>';
        echo 
'<tr><td>' $row[3] . '</td></tr><tr><td>---</td></tr>';
        echo 
'<tr><td><i>Written by: </i><b>' $row[1] . '</b>, <i>on</i> ' $date '</td></tr></table><br><br>';
    } else {
        }
    }
            
    
?>
For some reason, this is returning only 1 news post, and i don't know why, any one else does?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-11-04, 04:43 PM
cristiu cristiu is offline
Newbie Coder
 
Join Date: Oct 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
why do you test if ($result)? you don.t need this...try without if..else
__________________
Web Hosting & Domain Names UK
Webmaster Forums
[url=http://www.ukwebmasterworld.com/webmasterworld/]UK Webmaster
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-11-04, 04:52 PM
4n7hr4x 4n7hr4x is offline
Banned
 
Join Date: Jun 2004
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
ok i'll do that right now, thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-11-04, 04:54 PM
4n7hr4x 4n7hr4x is offline
Banned
 
Join Date: Jun 2004
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
that didnt work, same thing =(
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-11-04, 05:04 PM
4n7hr4x 4n7hr4x is offline
Banned
 
Join Date: Jun 2004
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
I took out the tables and it worked, funny how that was the problem.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 10-11-04, 05:05 PM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
you can run the query in your mysql console first, and let's see what will happen to the query.
__________________
just an ignorant noob with moronic solution...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 10-11-04, 05:08 PM
moronovich moronovich is offline
Junior Code Guru
 
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
oops, you typed faster than me..
__________________
just an ignorant noob with moronic solution...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 10-11-04, 06:49 PM
4n7hr4x 4n7hr4x is offline
Banned
 
Join Date: Jun 2004
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
lol, yeah, thx anyway
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sept Software Marketing News notepage General Advertisements 0 09-02-04 11:46 AM
News system with MySQL webdiary Script Requests 6 07-25-04 02:39 PM
Editing this news grabing script benj PHP 0 04-26-04 11:21 AM
Starting Small - A simple news script RaiTid_R PHP 4 03-06-04 01:45 PM


All times are GMT -5. The time now is 10:23 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.