Autor Zpráva
Zaciatok pomoc
Profil *
$query = MySQL_Query("SELECT * FROM `cheats` where like hra=".$_GET['pismeno']." order by id desc LIMIT 10") or die (mysql_error());

jak muzu tenhle kod udelat tak aby se vyhledavaly vysledky zdatabaze podle zacatecniho pismena naprikla uzivatel zada jenom s tak se mu vypise vsechno co s s zacina
Mastodont
Profil
Už asi desetkrát ti tu lidé doporučovali

http://www.linuxsoft.cz/php/
http://www.linuxsoft.cz/mysql/

Bude nutné ti to psát ještě hodně dlouho?
Nox
Profil
Zaciatok pomoc
A třeba jako proč bys to nemohl vyzkoušet? :)
Ti to zabere pár vteřin a nemusíš čekat na odpověď
Zaciatok pomoc
Profil *
ok diky skousel sem ale nic
Zaciatok pomoc
Profil *
kod

<a href="index.php?page=cheaty&amp;pismeno=1">A</a> <a
href="index.php?page=cheaty&amp;pismeno=2">B</a> <a
href="index.php?page=cheaty&amp;pismeno=3">C</a> <a
href="index.php?page=cheaty&amp;pismeno=4">D</a> <a
href="index.php?page=cheaty&amp;pismeno=5">E</a> <a
href="index.php?page=cheaty&amp;pismeno=6">F</a> <a
href="index.php?page=cheaty&amp;pismeno=7">G</a> <a
href="index.php?page=cheaty&amp;pismeno=8">H</a> <a
href="index.php?page=cheaty&amp;pismeno=9">I</a> <a
href="index.php?page=cheaty&amp;pismeno=10">J</a> <a
href="index.php?page=cheaty&amp;pismeno=11">K</a> <a
href="index.php?page=cheaty&amp;pismeno=12">L</a> <a
href="index.php?page=cheaty&amp;pismeno=13">M</a> <a
href="index.php?page=cheaty&amp;pismeno=14">N</a> <a
href="index.php?page=cheaty&amp;pismeno=15">O</a> <a
href="index.php?page=cheaty&amp;pismeno=16">P</a> <a
href="index.php?page=cheaty&amp;pismeno=17">R</a> <a
href="index.php?page=cheaty&amp;pismeno=18">S</a> <a
href="index.php?page=cheaty&amp;pismeno=19">T</a> <a
href="index.php?page=cheaty&amp;pismeno=20">U</a> <a
href="index.php?page=cheaty&amp;pismeno=21">V</a> <a
href="index.php?page=cheaty&amp;pismeno=22">W</a> <a
href="index.php?page=cheaty&amp;pismeno=23">X</a> <a
href="index.php?page=cheaty&amp;pismeno=24">Y</a> <a
href="index.php?page=cheaty&amp;pismeno=25">Z</a><br>
<?php
require_once "db.php";
$pismeno = $_GET["pismeno"];
$rest = substr("abcdefghijklmnoprstuvwxyz", $pismeno);
$query = MySQL_Query("SELECT * FROM `cheats` where hra like '$rest%' order by id desc LIMIT 10") or die (mysql_error());


ale porad nic
Jamboo
Profil *
WHERE hra LIKE 'pismeno%'....

procenta zastupující libovolné znaky v řetězci...
Zaciatok pomoc
Profil *
kod

<a href="index.php?page=cheaty&amp;pismeno=a">A</a> <a
href="index.php?page=cheaty&amp;pismeno=b">B</a> <a
href="index.php?page=cheaty&amp;pismeno=c">C</a> <a
href="index.php?page=cheaty&amp;pismeno=d">D</a> <a
href="index.php?page=cheaty&amp;pismeno=e">E</a> <a
href="index.php?page=cheaty&amp;pismeno=f">F</a> <a
href="index.php?page=cheaty&amp;pismeno=g">G</a> <a
href="index.php?page=cheaty&amp;pismeno=h">H</a> <a
href="index.php?page=cheaty&amp;pismeno=i">I</a> <a
href="index.php?page=cheaty&amp;pismeno=j">J</a> <a
href="index.php?page=cheaty&amp;pismeno=k">K</a> <a
href="index.php?page=cheaty&amp;pismeno=l">L</a> <a
href="index.php?page=cheaty&amp;pismeno=m">M</a> <a
href="index.php?page=cheaty&amp;pismeno=n">N</a> <a
href="index.php?page=cheaty&amp;pismeno=o">O</a> <a
href="index.php?page=cheaty&amp;pismeno=p">P</a> <a
href="index.php?page=cheaty&amp;pismeno=r">R</a> <a
href="index.php?page=cheaty&amp;pismeno=s">S</a> <a
href="index.php?page=cheaty&amp;pismeno=t">T</a> <a
href="index.php?page=cheaty&amp;pismeno=u">U</a> <a
href="index.php?page=cheaty&amp;pismeno=v">V</a> <a
href="index.php?page=cheaty&amp;pismeno=w">W</a> <a
href="index.php?page=cheaty&amp;pismeno=x">X</a> <a
href="index.php?page=cheaty&amp;pismeno=y">Y</a> <a
href="index.php?page=cheaty&amp;pismeno=z">Z</a><br>
<?php
require_once "db.php";
$pismeno = $_GET["pismeno"];
$query = MySQL_Query("SELECT * FROM `cheats` where hra like '$pismeno' order by id desc LIMIT 10") or die (mysql_error());

a kdys kliknu na pismeno m zobrazi se mi stejne vsechno
koudi
Profil
- nic -
Jamboo
Profil *
WHERE hra LIKE '$_GET["pismeno"]%'

jinak nevím, ale zkusil bych prohledat tady diskuze, určitě se to tu už řešilo...
Zaciatok pomoc
Profil *
tady je celej kod

<a href="index.php?page=cheaty&amp;pismeno=a">A</a> <a
href="index.php?page=cheaty&amp;pismeno=b">B</a> <a
href="index.php?page=cheaty&amp;pismeno=c">C</a> <a
href="index.php?page=cheaty&amp;pismeno=d">D</a> <a
href="index.php?page=cheaty&amp;pismeno=e">E</a> <a
href="index.php?page=cheaty&amp;pismeno=f">F</a> <a
href="index.php?page=cheaty&amp;pismeno=g">G</a> <a
href="index.php?page=cheaty&amp;pismeno=h">H</a> <a
href="index.php?page=cheaty&amp;pismeno=i">I</a> <a
href="index.php?page=cheaty&amp;pismeno=j">J</a> <a
href="index.php?page=cheaty&amp;pismeno=k">K</a> <a
href="index.php?page=cheaty&amp;pismeno=l">L</a> <a
href="index.php?page=cheaty&amp;pismeno=m">M</a> <a
href="index.php?page=cheaty&amp;pismeno=n">N</a> <a
href="index.php?page=cheaty&amp;pismeno=o">O</a> <a
href="index.php?page=cheaty&amp;pismeno=p">P</a> <a
href="index.php?page=cheaty&amp;pismeno=r">R</a> <a
href="index.php?page=cheaty&amp;pismeno=s">S</a> <a
href="index.php?page=cheaty&amp;pismeno=t">T</a> <a
href="index.php?page=cheaty&amp;pismeno=u">U</a> <a
href="index.php?page=cheaty&amp;pismeno=v">V</a> <a
href="index.php?page=cheaty&amp;pismeno=w">W</a> <a
href="index.php?page=cheaty&amp;pismeno=x">X</a> <a
href="index.php?page=cheaty&amp;pismeno=y">Y</a> <a
href="index.php?page=cheaty&amp;pismeno=z">Z</a><br>
<?php
require_once "db.php";
$pismeno = $_GET["pismeno"];
$rest = substr("abcdefghijklmnoprstuvwxyz", $pismeno);
$query = MySQL_Query("SELECT * FROM `cheats` where hra like '$rest' order by id desc LIMIT 10") or die (mysql_error());



define ("ROWS", 10);
if (!isset($_GET["celkem"]))
{
$vysledek=mysql_query("select count(*) as id from cheats");
$zaznam=mysql_fetch_array($vysledek);
$celkem=$zaznam["id"];
}
else
{
$celkem=$_GET["celkem"];
}
if ($celkem>ROWS)
{
if (!isset($_GET["od"])) $od=1; else $od=$_GET["od"];
$vysledek=mysql_query("select * from cheats"." limit ".($od-1).", ".ROWS);
if ($od==1) echo "";
else echo "<a href="".$_SERVER["PHP_SELF"]."?page=cheaty&celkem=$celkem&od=1"><b>Zac iatok</b></a>&nbsp;|&nbsp;";
if ($od<ROWS) echo "";
else echo "<a href="".$_SERVER["PHP_SELF"]."?page=cheaty&celkem=$celkem&od=".($od-RO WS).""><b>Naspät</b></a>&nbsp;|&nbsp;";
if ($od+ROWS>$celkem) echo "Nasledujúca&nbsp;|&nbsp;<BR>";
else echo "<a href="".$_SERVER["PHP_SELF"]."?page=cheaty&celkem=$celkem&od=".($od+RO WS).""><b>Nasledujúca</b></a>&nbsp;|&nbsp;";
if ($od>$celkem-ROWS) echo "<BR>";
else echo "<a href="".$_SERVER["PHP_SELF"]."?page=cheaty&celkem=$celkem&od=".($celke m-$celkem%ROWS+1).""><b>Posledná</b></a><BR><BR>";
}
while ($zaznam=MySQL_Fetch_Array($vysledek)){ echo "<div class=cheats>
<a href=index.php?page=cheats&id=".$zaznam["id"].">".$zaznam["hra"]."</a> </div><BR>";}
?>


a nefunguje to ukazuje to proste vsechno
Jamboo
Profil *
nwvím, ja to máš, ale určitě bych psal v tom odkazu: <a href="neco"?pismeno="A"&parametr="hodnota">popis</a>. Je otázkou, zda se vůbec PHP dozví to vybrané písmeno.
Zaciatok pomoc
Profil *
$pismeno = $_GET["pismeno"]; takhle se to dozvi ne
Jamboo
Profil *
to jo, ale musíš tam mít úvozovky, aby to rozlišilo název a hodnotu proměnné:

<a href="neco"?pismeno="A"&parametr="hodnota">

nevím, možná jsi to tam měl napsaný, ale v týhle diskuzi to neuložilo...
djlj
Profil
Proboha. Co to tady řešíte?

$query = MySQL_Query("SELECT * FROM `cheats` where hra like '".$_GET["pismeno"]."%' order by id desc LIMIT 10") or die (mysql_error());

Jamboo
Co to je za blbost?
Zaciatok pomoc
Profil *
novej kod

<a href="index.php?page=cheats_1&pismeno=a">A</a> <a
href="index.php?page=cheats_1&pismeno=b">B</a> <a
href="index.php?page=cheats_1&pismeno=c">C</a> <a
href="index.php?page=cheats_1&pismeno=d">D</a> <a
href="index.php?page=cheats_1&pismeno=e">E</a> <a
href="index.php?page=cheats_1&pismeno=f">F</a> <a
href="index.php?page=cheats_1&pismeno=g">G</a> <a
href="index.php?page=cheats_1&pismeno=h">H</a> <a
href="index.php?page=cheats_1&pismeno=i">I</a> <a
href="index.php?page=cheats_1&pismeno=j">J</a> <a
href="index.php?page=cheats_1&pismeno=k">K</a> <a
href="index.php?page=cheats_1&pismeno=l">L</a> <a
href="index.php?page=cheats_1&pismeno=m">M</a> <a
href="index.php?page=cheats_1&pismeno=n">N</a> <a
href="index.php?page=cheats_1&pismeno=o">O</a> <a
href="index.php?page=cheats_1&pismeno=p">P</a> <a
href="index.php?page=cheats_1&pismeno=r">R</a> <a
href="index.php?page=cheats_1&pismeno=s">S</a> <a
href="index.php?page=cheats_1&pismeno=t">T</a> <a
href="index.php?page=cheats_1&pismeno=u">U</a> <a
href="index.php?page=cheats_1&pismeno=v">V</a> <a
href="index.php?page=cheats_1&pismeno=w">W</a> <a
href="index.php?page=cheats_1&pismeno=x">X</a> <a
href="index.php?page=cheats_1&pismeno=y">Y</a> <a
href="index.php?page=cheats_1&pismeno=z">Z</a><br>
<?php
require_once "db.php";
$pismeno = $_GET["pismeno"];
define ("ROWS", 10);
if (!isset($_GET["celkem"]))
{
$vysledek=mysql_query("select count(*) as id from cheats where hra like '$pismeno'");
$zaznam=mysql_fetch_array($vysledek);
$celkem=$zaznam["id"];
}
else
{
$celkem=$_GET["celkem"];
}
if ($celkem>ROWS)
{
if (!isset($_GET["od"])) $od=1; else $od=$_GET["od"];
$vysledek=mysql_query("select * from cheats"." limit ".($od-1).", ".ROWS);
if ($od==1) echo "";
else echo "<a href="".$_SERVER["PHP_SELF"]."?page=cheaty&celkem=$celkem&od=1"><b>Zac iatok</b></a>&nbsp;|&nbsp;";
if ($od<ROWS) echo "";
else echo "<a href="".$_SERVER["PHP_SELF"]."?page=cheaty&celkem=$celkem&od=".($od-RO WS).""><b>Naspät</b></a>&nbsp;|&nbsp;";
if ($od+ROWS>$celkem) echo "Nasledujúca&nbsp;|&nbsp;<BR>";
else echo "<a href="".$_SERVER["PHP_SELF"]."?page=cheaty&celkem=$celkem&od=".($od+RO WS).""><b>Nasledujúca</b></a>&nbsp;|&nbsp;";
if ($od>$celkem-ROWS) echo "<BR>";
else echo "<a href="".$_SERVER["PHP_SELF"]."?page=cheaty&celkem=$celkem&od=".($celke m-$celkem%ROWS+1).""><b>Posledná</b></a><BR><BR>";
}
while ($zaznam=MySQL_Fetch_Array($vysledek)){ echo "<div class=cheats>
<a href=index.php?page=cheats&id=".$zaznam["id"].">".$zaznam["hra"]."</a> </div><BR>";}
?>



prosim mrknete na to
Zaciatok pomoc
Profil *
uz to de diky

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0