Jump to content

ardhix

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by ardhix

  1. 
    
    $aid = $_POST['artcid'];
    $uid = $_POST['userid'];

    header('location:../artikeldetail.php?msg=86&articleid='.$aid'&userid='.$uid);

     

    it returns Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

     

    the correct way to do this?

     

     

    header('location:../artikeldetail.php?msg=86&articleid='.$aid
    

     

    returns http://localhost/articles/artikeldetail.php?msg=86&articleid=24

     

    i want to show user id too

  2.  

    SELECT * FROM user_table as u JOIN content_article as a ON u.user_id = a.user_id JOIN article_category as c ON a.category_article_id=c.category_article_id WHERE . . . .
    

     

    it works somehow, thank you

  3. please help

     

    i have assignment to selecting tables by joining them..

     

    how do i use join, or inner join?

     

    is there another option selecting 3 tables by using foreign key?

     

    Here's the table

     

     

    this one is user table

     

    tabletuses.jpg

     

    here is article category

     

    tabletcategoryarticle.jpg

     

    and this is content of article

     

    tartikel.jpg

     

     

     

    i was willing to choosing 

     

     

    article_news table = 
     
    article_id, category_article_id, user_type_id, user_id, judul(title), artikel, photo, tag, tanggal
     
     
    tcategory_article = 
     
    category_article_id, category_article
     
     
    tuser = 
     
    user_type_id, firstname, lastname
     
     
     
    thank you
  4. Your query is failing for some reason. Change this line:

     

     

    $query = mysql_query($sql_query);

     

    To this:

     

    $query = mysql_query($sql_query) or die(mysql_error());

     

    Run the script again, and let us know the output.

     

     

    now it shows message :

     

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

  5. i have found warning message =  Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given inC:\xampp\htdocs\articles\artikel.php on line 7

     

     

      

     

    <?php
       include 'koneksi.php';
    $articleid = $_GET['articleid'];
    $sql_query = 'SELECT ta.*, tca.category_article FROM article_news AS ta INNER JOIN tcategory_article AS tca ON ta.category_article_id = tca.category_article_id WHERE article_id = '.$articleid;
    $query = mysql_query($sql_query);
    $row = mysql_fetch_array($query); //--> this is line #7 
    
    
    $msg = $_GET['msg'];
    if(!empty($msg)){
    if($msg = 100){
    echo '<h5 style="text-align:center; color:#f00; font-weight: normal">.</h5>';
    }
    } 
    ?>
    
    
      <!--articles-->
      <a name="TemplateInfo"></a>
      <input type="hidden" name="prodid" value="<?php echo $row['article_id'];?>" size="1"/>
    <h1><?php echo $row['judul'];?></h1>
    <p><a href=""><img src="images/upload/<?php echo $row['photo'];?>" width="100" height="120" class="float-left"></a>
                    <p><?php echo $row['artikel'];?></a>.
                    </p>
    <!--end of articles-->
                    
    <p><?php echo $row['category_article'];?></p>
    <p class="post-footer"> 
    <a href="index.html" class="readmore">Read more</a>
    <a href="index.html" class="comments">Comments (7)</a>
    <span class="date"><?php echo $row['tanggal'];?></span> 
    </p>
     
    
    

     

    please help me :)
     
    i'm sorry newbie here..
×
×
  • 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.