ardhix
-
Posts
8 -
Joined
-
Last visited
Posts posted by ardhix
-
-
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
-
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
here is article category
and this is content of article
i was willing to choosing
article_news table =article_id, category_article_id, user_type_id, user_id, judul(title), artikel, photo, tag, tanggaltcategory_article =category_article_id, category_articletuser =user_type_id, firstname, lastnamethank you -
there's no value in $articleid, because no data passed to it (it used for detail of article)
-
What does this show:
die($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);
I'm thinking $articleid is empty.
Solved now.. by removing $articleid, the data shows up, thank you very much
-
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
-
i've change
Please wrap your code in code tags. You can do this using the <> button in the editor. As well, always point out which line is referred to in the error (in this case, which line is #53?).
i've change with editor, is that correct?
-
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 mei'm sorry newbie here..
PHP Header help
in PHP Coding Help
Posted · Edited by ardhix
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?
returns http://localhost/articles/artikeldetail.php?msg=86&articleid=24
i want to show user id too