ziedinjsh Posted May 19, 2012 Report Share Posted May 19, 2012 Sveiki! Īsti nesaprotu kapēc nerāda datus ieejot zem šāda action: <form method='post' action='process/process.download.php?download=midi&id=".$data['id']."'> <input type='submit' name='download' value='Download'> </form> php <?php include("../misc/dbase.php"); $download = isset($_GET['download'])?$_GET['download']:''; if($download=="midi"){ $id = isset($_GET['id'])?$_GET['id']:''; $midi = mysql_query("select * from midi where id='".$id."' limit 1") or die(mysql_error()); while($data = mysql_fetch_array($midi)){ echo $data['title']; } } ?> tāpat nekas nenotiek ja izmantoju šo: if($download=="midi"){ $id = isset($_GET['id'])?$_GET['id']:''; $data = mysql_fetch_array(mysql_query("select * from midi where id='".$id."' limit 1")) or die(mysql_error()); echo $data['title']; } Parāda vienkārši baltu lapu abos gadījumos Quote Link to comment Share on other sites More sharing options...
ezis Posted May 19, 2012 Report Share Posted May 19, 2012 (edited) action='process/process.download.php?download=midi&id=".$data['id']."' Highlight nepasaka priekšā? woops, neiedomājos, Tu to formu taču echo ar double quotes vai arī tā kā esi ievietojis šeit tā arī ir? Edited May 19, 2012 by ezis Quote Link to comment Share on other sites More sharing options...
daGrevis Posted May 19, 2012 Report Share Posted May 19, 2012 Debug it! Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted May 19, 2012 Author Report Share Posted May 19, 2012 ar dubūtajā ķepām jā echo "<div id='".$data['id']."' style='display:none;'> <p style='color:#333;font-size:18px;font-weight:bold;'>".$data['title']." | <span style='color:#666;font-size:14px;'>".$data['bpm']." bpm</span> </p> <center><form method='post' action='process/process.download.php?download=midi&id=".$data['id']."'> <input type='submit' name='download' value='Download' class='download'> </form></center> </div>"; Quote Link to comment Share on other sites More sharing options...
ezis Posted May 19, 2012 Report Share Posted May 19, 2012 (edited) Tad kā jau dG teica, debug it <?php error_reporting(E_ALL); include("../misc/dbase.php"); $download = isset($_GET['download'])?$_GET['download']:''; if($download=="midi"){ $id = isset($_GET['id'])?$_GET['id']:''; $midi = mysql_query("select * from midi where id='".$id."' limit 1") or die(mysql_error()); while($data = mysql_fetch_array($midi)){ echo $data['title']; } } un skaties, kas nav riekstā! Ja neko neizmet, tad echo kaut ko pēc if un skaties vai vispār tik tālu tiek utt. utjp. Bez tam, noteikti būtu nepieciešams vispirms pārbaudīt vai mysql_query atgriež rezultātu. Tīri visur additional messages, lai zinātu, kas kur notiek. Edited May 19, 2012 by ezis Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted May 20, 2012 Author Report Share Posted May 20, 2012 (edited) error_reporting(E_ALL); tas jau man ir iekš dbase.php faila kas ir includots! ieliku vēl papildus, bet tas neko nemaina.. tukša lapa! arī parastu tekstu neparāda ja ieraksta iekšā iekš if($download=="midi"){ $id = isset($_GET['id'])?$_GET['id']:''; $data = mysql_fetch_array(mysql_query("select * from midi where id='".$id."' limit 1")) or die(mysql_error()); echo $data['title']; echo "zb"; } tekstu viņš parāda tikai tajā gadījumā, ja tiek ižnemta šī rindiņa: $data = mysql_fetch_array(mysql_query("select * from midi where id='".$id."' limit 1")) or die(mysql_error()); Pilnīgi neko nesaprotu! Edited May 20, 2012 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted May 20, 2012 Author Report Share Posted May 20, 2012 Tā problēmu atradu.. paša nolaidība if($download=="midi"){ $id = isset($_GET['id'])?$_GET['id']:''; $data = mysql_fetch_array(mysql_query("select midi.id, midi.title, midi.bpm, midi.name, midi.date, midi.code, updates.code from midi, updates where updates.id=".$id." and updates.code=midi.code ")) or die(mysql_error()); echo $data['title']; } Quote Link to comment Share on other sites More sharing options...
daGrevis Posted May 20, 2012 Report Share Posted May 20, 2012 Tu laikam nezini, ko nozīmē koda debagošana... vai ne? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted May 20, 2012 Author Report Share Posted May 20, 2012 laikam jau nē! Quote Link to comment Share on other sites More sharing options...
daGrevis Posted May 20, 2012 Report Share Posted May 20, 2012 http://stackoverflow.com/questions/888/how-do-you-debug-php-scripts 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.