Jump to content

Azzyh

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Azzyh's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for reply. Hello How do I echo out the data??
  2. Azzyh

    Inner JOIN

    So let me try: $sql = "SELECT * FROM `member_film` INNER JOIN `member_tutorials` ORDER BY dato DESC");"; Is the ORDER by dato correct if you have a column dato in both member_tutorials and member_film? And what if i want to add a extra table into it, member_tutorials? - In what way should i echo out the data? Just like normal? Like if there's a column in member_tutorials called title, should i call it this way: $show = mysql_fetch_array($sql); echo $show['title'];
  3. Azzyh

    Inner JOIN

    Hi i am new to using JOIN, and i think Inner JOIN is the right function that i shall use. So heres what i tried: $sygo = mysql_query("SELECT member_film.title, member_film.username, member_tutorials.title, member_tutorials.type, member_tutorials.username FROM member_film INNER JOIN member_tutorials ORDER BY dato DESC"); Now what i want to do is, to get data's out of those table columns and then show it ordering it all by which dato there's soonest. All the tables do have a column called Dato, and i want it to sort out of that. I think what i did is compleltly wrong, so help me out please. And how do i then echo out the data in a correct way?
  4. Hey again what if the table "buisness" and "sports" doesnt have the same field, i mean if sports have: "topic" as field name, and in buisness table it's "title", how should i do to get it out both? thanks
  5. Thanks Buddski. ASC worked well for me
  6. Hi. I want to order the stuff that comes out of the query, by the closest dato matching and following. So like if the datetime right now is: 21/21/08 3:15 pm and theres a row with field "dato" that has 21/21/08 3:10 <- this should be the first on the top and then following.. hope you understand i tried myself alittle: $timenow = date('d/m/Y G:i:s'); ORDER BY dato < ($timenow) but doesnt seem to be right
  7. Thank you SWD. I found out was UNION statement was and used it, heres source, and i got what i wanted. <?php include("../tilslut.php"); $hent_stuff = mysql_query("SELECT * FROM nyheder UNION SELECT * FROM artikler UNION SELECT * FROM debat ORDER BY id DESC LIMIT 6"); echo "<b>Seneste Nyt:<br></b>"; while($sum = mysql_fetch_array($hent_stuff)) { echo $sum['title'] . " Dato: " . $sum['dato']."<br>"; } ?>
  8. Thanks for reply But what if i do have those 3 tables, and not a column news_category. Cause i wish to make this for other 3 tables too, which aint in news..
  9. Hello. I dont know what UNION statement is, but i understanded the rest of it. And by datetime, you mean so each rows have datetimes stamps, and you then check for the latest through date(); ? why not just order by id ? Im going to search up what UNION statement is
  10. If you go to http://www.foxnews.com, and scroll down a little you would see the box "LATEST NEWS". Now i want to do something like that, kinda, but with modification. I have 3 queries, that gets out information from 3 tables. And each table have around 5 tables and counting, with different types of news. Those 3 tables are these types of News: Buisness, Politics and Sports. Now i want to make a box, (i can do this in css), that displays the latest table of those 3 tables. So let me give you an example to understanding better: Here's 5 news title's: Building a Brewery on a Shoestring Obama Stumps for Coakley in Surprisingly Tight Massachusetts Senate Race Wide Write: The Week 17 Scramble Report: Doctor linked to Tiger part of PED probe Did coach hit player? South Florida to look into it And these titles(news) are from those 3 tables.. And then lets say i create a new column in "Sports", then it should update so it would be like this: This Is A Title For Sport Building a Brewery on a Shoestring Obama Stumps for Coakley in Surprisingly Tight Massachusetts Senate Race Wide Write: The Week 17 Scramble Report: Doctor linked to Tiger part of PED probe Did coach hit player? South Florida to look into it Hope you all understand. Really appreciate this, ive been searching pretty long, and ended up here, phpfreaks.com the best? : )
  11. What if i want to get from 3 table's and not just 1 ? thanks for reply
  12. Hello phpfreaks.com! I want to learn how to make a script, that receives the latest column inserted in 3 tables, and then shows them with fields title and date. Checks for the last column by the latest id... order by id maybe? I dont know how to do this, as i never had that in thought. Ive seen this happend in many sites, and in forums like "Latest posts" where its a box showing the poster's username and the title of the thread. So i know this is possible. Thanks
  13. Azzyh

    Charset?

    Wops, im sorry.. here's the code, and i tried SET NAMES at the top of the pages, it didnt help it.. :/ <html> <head> <link href="../style.css" type="text/css" rel="stylesheet" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript" type="text/javascript"> <? include "../tilslut.php"; $hent_battle = mysql_query("SELECT * FROM member_battles WHERE id = '$_GET[id]'") or die(mysql_error()); $vis = mysql_fetch_array($hent_battle); $bID = $_GET["id"]; $sql = "SELECT id FROM member_battlevotes WHERE bID = '$_GET[id]' AND stemme = '".mysql_real_escape_string($vis['modstander'])."'"; $query = mysql_query($sql); $number = mysql_num_rows($query); $sql2 = "SELECT id FROM member_battlevotes WHERE bID = '$_GET[id]' AND stemme = '".mysql_real_escape_string($vis['modstander2'])."'"; $query2 = mysql_query($sql2); $number2 = mysql_num_rows($query2); $vindernummer = $vis["vindernum"]; $resultat2 = $number2; $resultat1 = $number; $resultatdone = "".$resultat1.":".$resultat2.""; $ko = $vis["ko"]; ?> <div align="center"><br> <img src="battles.jpg"> <br> <b><span class="title2"><? echo "$vis[modstander]"; ?></b></span> vs. <span class="title2"><b><? echo "$vis[modstander2]"; ?></span></b><br> ?> This line above ^ that gets out fields Modstander and Modstander2, contains both charachers with ÆØÅ, and shows as ???
  14. Azzyh

    Charset?

    Hello.. I have a page in php, and a script that gets info from the database.. Now the page is meta charset utf-8, and it shows words ÆØÅ perfect.. but when the script gets info from the database, it doesnt show ÆØÅ right, but showing ???..
  15. Hm, pretty funny in the database field "info" there is a sentence: This Is A Test For The ÆØÅ , and in the file index.php, there is ÆØÅ that shows correctly, but when im trying to grab that sentence from the database, it outputs "This Is A Test For The ???"... whats wrong?
×
×
  • 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.