Jump to content
php.lv forumi

Neparāda datus


ziedinjsh

Recommended Posts

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

Link to comment
Share on other sites

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 by ezis
Link to comment
Share on other sites

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>";

Link to comment
Share on other sites

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 by ezis
Link to comment
Share on other sites

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 by ziedinjsh
Link to comment
Share on other sites

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'];
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...