neprasa Posted December 10, 2006 Report Share 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 Link to comment Share on other sites More sharing options...
andrisp Posted December 10, 2006 Report Share 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. Link to comment Share on other sites More sharing options...
rider_lv Posted December 10, 2006 Report Share 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']; } ?> Link to comment Share on other sites More sharing options...
neprasa Posted December 10, 2006 Author Report Share 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 Link to comment Share on other sites More sharing options...
neprasa Posted December 10, 2006 Author Report Share Posted December 10, 2006 nu paliidziet luuudzu Link to comment Share on other sites More sharing options...
andrisp Posted December 10, 2006 Report Share Posted December 10, 2006 Ko ? Pateikt priekšā vai strādā vai nē ? Taču pats pamēģini. Link to comment Share on other sites More sharing options...
neprasa Posted December 18, 2006 Author Report Share Posted December 18, 2006 bet tapat nestradaa :( Link to comment Share on other sites More sharing options...
andrisp Posted December 18, 2006 Report Share 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 ? Link to comment Share on other sites More sharing options...
neprasa Posted December 20, 2006 Author Report Share Posted December 20, 2006 kur var ieslegt? Link to comment Share on other sites More sharing options...
andrisp Posted December 20, 2006 Report Share Posted December 20, 2006 http://www.google.lv/search?hl=lv&q=error+reporting+php Link to comment Share on other sites More sharing options...
neprasa Posted December 20, 2006 Author Report Share Posted December 20, 2006 un ka man vinu pievienot Link to comment Share on other sites More sharing options...
andrisp Posted December 20, 2006 Report Share 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); Link to comment Share on other sites More sharing options...
Val Posted December 20, 2006 Report Share Posted December 20, 2006 šo varbūt domāji? <?php error_reporting(E_ALL); //te nāk viss pārējais sviests ?> Link to comment Share on other sites More sharing options...
hmnc Posted December 20, 2006 Report Share 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); Link to comment Share on other sites More sharing options...
neprasa Posted December 20, 2006 Author Report Share Posted December 20, 2006 problema ir rakstisana , bet nolasisana nav , jo pameginaju nolasit no phpbb foruma kurs gaja lidzi serverim un viss nolasijaas :) Link to comment Share on other sites More sharing options...
Recommended Posts