marekmasterina Posted February 16, 2015 Share Posted February 16, 2015 (edited) Hi; I'm writing a php script which is about advertising.I created a table and i wanted to get informations from the column which is in the table , is named "tema".For example ;i created a table which is called "ilan" ; and in the table i created a column which is named "tema" i got the information from the MYSQL "tema='tehnika'" everything is allright till this moment after this when i opened my php file i couldnt see the ROW which is "tema='tehnika'" in the index although i got to one row .. When i look the sources of my index i see that PHP got allrows and also when i search the browser other rows browser can find but it doesnt show where these words are located :S first i think maybe something wrong with my CSS properties. but it is not about CSS so where is the wrong ? ???? This is my source codes: <?php require_once('baglan.php');//i connected to Database// if($db->connect_errno) die("Veritabanına bağlanılamıyor.".$db->connect_error()); $db->set_charset("utf-8"); $toplam=$db->prepare("SELECT count(*) FROM ilanlar WHERE tema='tehnika'"); $toplam->execute(); $sayfa_sayisi=$toplam->get_result(); $sayfacik=$sayfa_sayisi->fetch_row(); $toplam->close(); $sql=$db->prepare("SELECT * FROM ilanlar WHERE tema='tehnika' Order By id DESC LIMIT ? OFFSET ?"); $limit=4; $offset=isset($_GET["id"]) ? $_GET["id"] : 0 ; $sql->bind_param("ii",$limit,$offset); $sql->execute(); $sql_sonuc=$sql->get_result(); while($row=$sql_sonuc->fetch_array()) { echo "<div id='ilanlar'> <h1><img src='yuklemeler/{$row["fotoadi"]}'><a href=detay.php?id={$row["id"]}>{$row["konu"]}</a></h1> <p><h3>{$row["tarih"]}</h3></p> <br/></div> "; } if($sayfacik[0]>$limit) { $x = 0 ; for($i = 0 ; $i<$sayfacik[0];$i+=$limit) { $x++; } } $db->close(); ?> http://i57.tinypic.com/2ccow9x.png Edited February 16, 2015 by Ch0cu3r Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted February 16, 2015 Share Posted February 16, 2015 (edited) Not quite understanding you. But from the screenshot I think I know what the issue is. I can tell you it is not PHP as you can clearly see from the screenshot the PHP code you posted is outputting the HTML for each "ad" from your MySQL database. The problem I do see is only one "ad" is being shown in the browser which means their is a problem with your HTML/CSS code. Without seeing the HTML/CSS code we cannot really help you futher. Any code you post please wrap it wihin tags (or click the <> button in the editor) Edited February 16, 2015 by Ch0cu3r Quote Link to comment Share on other sites More sharing options...
marekmasterina Posted February 16, 2015 Author Share Posted February 16, 2015 (edited) Hi mate ; absolutely i must see php codes in html codes because this codes when i run the PHP files i saw.When u run PHP files in the browser it doesnt show PHP codes these codes are from "MYSQL" my codes get the all "tema=tehnika" rows but it doesnt show this in the browser.. Only one row it shows..others it doesnt get .. $sql=$db->prepare("SELECT * FROM ilanlar WHERE tema='tehnika' Order By id DESC LIMIT ? OFFSET ?"); $limit=4; $offset=isset($_GET["id"]) ? $_GET["id"] : 0 ; $sql->bind_param("ii",$limit,$offset); $sql->execute(); $sql_sonuc=$sql->get_result(); while($row=$sql_sonuc->fetch_array()) { echo "<div id='ilanlar'> <h1><img src='yuklemeler/{$row["fotoadi"]}'><a href=detay.php?id={$row["id"]}>{$row["konu"]}</a></h1> <p><h3>{$row["tarih"]}</h3></p> <br/></div> "; } This php codes like this in HTML ->it gets rows from MYSQL and print it these in HTML <div id='ilanlar'> <h1><img src='yuklemeler/123.jpg'><a href=detay.php?id=3>sadas</a></h1> <p><h3>2015-02-15 19:06:53</h3></p> <br/></div> <div id='ilanlar'> <h1><img src='yuklemeler/123.jpg'><a href=detay.php?id=2>bmwalirmssaaaaaa</a></h1> <p><h3>2015-02-15 19:00:55</h3></p> <br/></div> <div id='ilanlar'> <h1><img src='yuklemeler/123.jpg'><a href=detay.php?id=1>SATILIK WOLKSVAGEN</a></h1> <p><h3>2015-02-15 18:39:55</h3></p> <br/></div> </div> Edited February 16, 2015 by marekmasterina Quote Link to comment Share on other sites More sharing options...
raphael75 Posted February 16, 2015 Share Posted February 16, 2015 Different browsers are picky about the syntax of the HTML tags. values should always be enclosed in double-quotes, so where you have: <img src='yuklemeler123.jpg'> or <a href=detay.php?id=2> change it to <img src="yuklemeler123.jpg"> or <a href="detay.php?id=2"> Quote Link to comment Share on other sites More sharing options...
raphael75 Posted February 16, 2015 Share Posted February 16, 2015 It's also possible that enclosing the <h3> inside <p> is causing problems, especially if the <p> is floating. I'm pretty sure it's a CSS/HTML issue, because all the data is there in the code in the screenshot. I think all the rows are on top of each other due to CSS positioning. Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted February 16, 2015 Share Posted February 16, 2015 absolutely i must see php codes in html codes because this codes when i run the PHP files i saw.When u run PHP files in the browser it doesnt show PHP codes these codes are from "MYSQL" my codes get the all "tema=tehnika" rows but it doesnt show this in the browser.. Only one row it shows..others it doesnt get .. Yes. I know that. What I want you to do is post the full HTML structure (including your CSS code) by right clicking the page and selecting view source. I am not interested in your PHP code as I said earlier is not the cause of the problem. I have a feeling it something in the HTML/CSS code which causing the ads to be displayed on top of each other which is why you are only seeing one "ad" being shown. Quote Link to comment Share on other sites More sharing options...
marekmasterina Posted February 16, 2015 Author Share Posted February 16, 2015 <?php require_once('baglan.php'); if($db->connect_errno) die("Veritabanına bağlanılamıyor.".$db->connect_error()); $db->set_charset("utf-8"); $toplam=$db->prepare("SELECT count(*) FROM ilanlar WHERE tema='tehnika'"); $toplam->execute(); $sayfa_sayisi=$toplam->get_result(); $sayfacik=$sayfa_sayisi->fetch_row(); $toplam->close(); $sql=$db->prepare("SELECT * FROM ilanlar WHERE tema='tehnika' Order By id DESC LIMIT ? OFFSET ?"); $limit=4; $offset=isset($_GET["id"]) ? $_GET["id"] : 0 ; $sql->bind_param("ii",$limit,$offset); $sql->execute(); $sql_sonuc=$sql->get_result(); while($row=$sql_sonuc->fetch_array()) { echo "<div id='ilanlar'> <table><tr><td><img src='yuklemeler/{$row["fotoadi"]}'><a href=detay.php?id={$row["id"]}><h1>{$row["konu"]}</h1></a></td> <td><h2>{$row["tarih"]}</h2></td></tr></table> <br/></div> "; } if($sayfacik[0]>$limit) { $x = 0 ; for($i = 0 ; $i<$sayfacik[0];$i+=$limit) { $x++; } } $db->close(); ?> Quote Link to comment Share on other sites More sharing options...
marekmasterina Posted February 16, 2015 Author Share Posted February 16, 2015 #ilanlar{ margin-bottom:300px; background-color:#EEEEEE; border:solid 2px #D0D0D0; position:absolute; width:100%; height:350px; top:150px;} #ilanlar table { width:100%; position:absolute; left:0px; top:2px;} #ilanlar td h2 { font-size:12px; position:absolute; left:950px;} #ilanlar img { width:100px; height:70px; position:absolute; left:5px;} #ilanlar h1 { font-size:15px; font-weight:bold; position:absolute; left:120px;} #ilanlar td { top:10px; display:inline-block; font-size:14px; width:100%; left:10px; position:relative;} Quote Link to comment Share on other sites More sharing options...
Solution marekmasterina Posted February 16, 2015 Author Solution Share Posted February 16, 2015 mates i did it .. the problem was #ilanlar ... position:absolute ... i did it relative and now everything is allright thx .. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.