IBEX Posted November 5, 2008 Report Share Posted November 5, 2008 (edited) pienjemsim man ir lapa kur radas visi lietotaaji. vinu vards ir linka, kas ved uz profila lapu. // index.php?id=user&id=lietotaaja_id.. Tas man ir, talak man vajag izveidot to lietotaaju_profils.php es štukoju, kko tādu.. domāju, ka doma ir pareiza, bet kodā kkas nepareizs.. raada NEKO. <?php if(isset($_GET['id']) == 'id' AND $_GET['id']) { $r = mysql_query("SELECT * FROM lietotaaji WHERE id = {$_GET['id']}"); $r = mysql_fetch_arraY($r); { echo " " . $r['id'] . " " . $r['vaards'] . " " . $r['uzvaards'] . " "; } ?> Edited November 5, 2008 by IBEX Link to comment Share on other sites More sharing options...
vacant Posted November 5, 2008 Report Share Posted November 5, 2008 (edited) <?php if(isset($_GET['id']) && !empty($_GET['id'])) { $q = mysql_query("SELECT * FROM lietotaaji WHERE id = {$_GET['id']}"); $r = mysql_fetch_array($q); echo " " . $r['id'] . " " . $r['vaards'] . " " . $r['uzvaards'] . " "; } ?> vēl pieņemsim var uzlikt pārbaudi vai id is_numeric Edited November 5, 2008 by vacant Link to comment Share on other sites More sharing options...
Zandis Murāns Posted November 5, 2008 Report Share Posted November 5, 2008 index.php?id=user&id=lietotaaja_id divi parametri ar vienu nosaukumu? Es nezinu, kuru php paņems kā $_GET['id']; Link to comment Share on other sites More sharing options...
andrisp Posted November 5, 2008 Report Share Posted November 5, 2008 Zandi, pēdējo. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted November 5, 2008 Report Share Posted November 5, 2008 divi parametri ar vienu nosaukumu? Kas tas par sviestu ??? Principaa katraa servera konfiguraacijaa & PHP versija sajaa gadijumaa var atskjirties .. Link to comment Share on other sites More sharing options...
andrisp Posted November 5, 2008 Report Share Posted November 5, 2008 Hm, Grey_Wolf, kāds tam sakars ? Link to comment Share on other sites More sharing options...
IBEX Posted November 5, 2008 Author Report Share Posted November 5, 2008 to jeu principā var nomainīt, tas ta būtu sīkums.. Link to comment Share on other sites More sharing options...
Zandis Murāns Posted November 5, 2008 Report Share Posted November 5, 2008 Vārdu sakot, izdari echo "SELECT * FROM lietotaaji WHERE id = {$_GET['id']}"; un paskaties, kāds izskatās tavs kverijs. Link to comment Share on other sites More sharing options...
andrisp Posted November 5, 2008 Report Share Posted November 5, 2008 Vispār, wtf ir šitas ? :) isset($_GET['id']) == 'id' Link to comment Share on other sites More sharing options...
Zandis Murāns Posted November 5, 2008 Report Share Posted November 5, 2008 Kas, tu neredzi? Ja booleans ir vienāds ar strings, tad izteiksme ir pareiza. Link to comment Share on other sites More sharing options...
andrisp Posted November 5, 2008 Report Share Posted November 5, 2008 Zandi, protams, ka es redzu, bet loģika kāda izmantot tādu sviestainu kodu ? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted November 5, 2008 Report Share Posted November 5, 2008 Hm, Grey_Wolf, kāds tam sakars ? njaa ... garumziimiites :( -- Domats ka panjems no 2 vienadiem ... -- if(isset($_GET['id']) == 'id' AND $_GET['id']) IMPHO nekad neizpildiisies .. Jo isset() atgriez True/false (boilen) un nekad !!! nebuus vienads ar 'id' .. Link to comment Share on other sites More sharing options...
andrisp Posted November 5, 2008 Report Share Posted November 5, 2008 Grey_Wolf, ar == pārbaudot, true ir vienāds ar jebkuru stringu. Tā kā darbosies gan. Un vienalga nesapratu tavu "Principaa katraa servera konfiguraacijaa & PHP versija sajaa gadijumaa var atskjirties .. "... Link to comment Share on other sites More sharing options...
MrEnerg Posted February 7, 2009 Report Share Posted February 7, 2009 A kur likt to kodu user id! Link to comment Share on other sites More sharing options...
Recommended Posts