neprasa Posted December 10, 2006 Report Posted December 10, 2006 http://www.w3schools.com/php - meginaju to visu , uztaisiju db , tadu tabulu , tad ar to skirptu taisu insert, vins nekadus erorus nemet, tad nemu nolasit, un atkal neko nerada, tikai baltu lapu
andrisp Posted December 10, 2006 Report Posted December 10, 2006 Izsauc uzreiz pēc kverija mysql_error(); fju. Un parādi kodus, ko izmanto, savādāk varam tikai minēt, kas par vainu.
rider_lv Posted December 10, 2006 Report Posted December 10, 2006 Ieliec koda sākuma error_reporting(E_ALL & ~E_NOTICE); Datubāzē var ierakstīt <?php mysql_query("INSERT INTO tabula (vards, uzvards, niks)VALUES ('Jānis','Lapiņš','Janka')"); ?> Nolasīt no datubāzes var <?php $result = mysql_query("SELECT * FROM tabula "); while ($row = mysql_fetch_assoc($result)) { echo $row['vards']; echo $row['uzvards']; echo $row['niks']; } ?>
neprasa Posted December 10, 2006 Author Report Posted December 10, 2006 (edited) nolasit <?php $con = mysql_connect("localhost","es","es"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("tests", $con); $result = mysql_query("SELECT * FROM tabula "); while ($row = mysql_fetch_assoc($result)) { echo $row['vards']; echo $row['uzvards']; echo $row['niks']; } mysql_close($con) ?> ierakstiit <?php $con = mysql_connect("localhost","es","es"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("tests", $con); mysql_query("INSERT INTO tabula (vards, uzvards, niks)VALUES ('Jānis','Lapiņš','Janka')"); mysql_close($con) ?> taa ? Edited December 10, 2006 by neprasa
andrisp Posted December 10, 2006 Report Posted December 10, 2006 Ko ? Pateikt priekšā vai strādā vai nē ? Taču pats pamēģini.
andrisp Posted December 18, 2006 Report Posted December 18, 2006 Cik uzmetu aci, tad ar kodu viss kārtībā. Pārliecināts, ka konekcija vispār tiek izveidota ? Tādas tabulas eksistē ? Tev error_reportings ir ieslēgts ?
andrisp Posted December 20, 2006 Report Posted December 20, 2006 http://www.google.lv/search?hl=lv&q=error+reporting+php
andrisp Posted December 20, 2006 Report Posted December 20, 2006 neprasa, būtu paņemis pirmo linku gūglē, parullējis nedaudz uz leju, un atradis šo: error_reporting(E_ALL);
Val Posted December 20, 2006 Report Posted December 20, 2006 šo varbūt domāji? <?php error_reporting(E_ALL); //te nāk viss pārējais sviests ?>
hmnc Posted December 20, 2006 Report Posted December 20, 2006 neaizmirstam, ka uz darbserveriem display errors vairākumā gadījumu ir atslēgts. labot to var šādi: ini_set('display_errors',1);
neprasa Posted December 20, 2006 Author Report Posted December 20, 2006 problema ir rakstisana , bet nolasisana nav , jo pameginaju nolasit no phpbb foruma kurs gaja lidzi serverim un viss nolasijaas :)
Recommended Posts