georgeuk Δημοσ. 10 Μαρτίου 2008 Δημοσ. 10 Μαρτίου 2008 paidia exo to eksis problima. exo ena pinaka me 4 fields id, title, author, price thelo na ftiakso ena page se php oste na mporo na sbino biblia. egrapsa ayto to kodika alla gia kapio logo den mu bgazei ta records <?php //connect to mysql //change user and password to your mySQL name and password mysql_connect("localhost","georgeuk_george","faliraki"); //select which database you want to edit mysql_select_db("georgeuk_eshop"); //If cmd has not been initialized if(!isset($cmd) { //display all the books $result = mysql_query("select * from books order by id"); echo '<table border="1">'; echo "<tr> <th>id</th> <th>title</th> <th>author</th> <th>price</th> <th>Remove</th></tr>"; //run the while loop that grabs all the news scripts while($r=mysql_fetch_array($result)) { echo "<tr><td>"; echo $id["id"] . '</td><td>'; echo $title["title"] . '</td><td>'; echo $author["author"] . '</td><td>'; echo $price["price"] . '</td><td>'; echo '<a href="delete.php?id='.$result_row["id"].'">Click to remove from books</a></td></tr>'; } echo '</table>'; } ?> pu einai to lathos mu kamia idea?
Uberalles_gr Δημοσ. 11 Μαρτίου 2008 Δημοσ. 11 Μαρτίου 2008 //run the while loop that grabs all the news scripts while($r=mysql_fetch_array($result)) { echo "<tr><td>"; echo $id["id"] . '</td><td>'; echo $title["title"] . '</td><td>'; echo $author["author"] . '</td><td>'; echo $price["price"] . '</td><td>'; echo '<a href="delete.php?id='.$result_row["id"].'">Click to remove from books</a></td></tr>'; } Αυτό είναι τελείως λάθος που έγραψες.. Τα αποτελέσματα σου τα βάζεις στην μεταβλητή $r επομένως πρέπει να γράψεις $r[0] είναι για το id, $r[1] είναι για το title κλπ.... Ελπίζω να βοήθησα..
Προτεινόμενες αναρτήσεις
Αρχειοθετημένο
Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.