Sephy Posted September 8, 2011 Report Share Posted September 8, 2011 (edited) Tatad man ir image tagi, teiksim <img src="Galerijas/bilde.jpg" value="0" class="active"> <img src="Galerijas/citabilde.jpg" value="1"> <img src="Galerijas/unit.jpg" value="2"> Katrai bildei ir savi ierasti(saistiti ar bildes sourcu) Mysql tabula. Value liecina kāda alfabēta secībā ir bilžu linki. Ka varetu uztaisit, lai no MySql panem vertības kad bilde ir aktīva! noderes ari noderi keywordi prieksh google etc ;) Te Mysql kods, vajdzetu lai ta $hurrdurr vertiba ir vienada ar value un panemas no active img ;) $dbhost = 'localhost'; $dbuser = 'hpageuser'; $dbpass = '1337'; $dbname = 'hpage'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname) or die ('Cannot select database'); $hurrdurr=3; $title = mysql_query("SELECT * FROM bilzhaprakstiii WHERE newid='$hurrdurr'"); $row = mysql_fetch_array( $title ); echo $row['bildesapraksts']; Edited September 8, 2011 by Sephy Quote Link to comment Share on other sites More sharing options...
mounkuls Posted September 9, 2011 Report Share Posted September 9, 2011 Tā īsti nesapratu visu, bet man liekas, ka to value jau ir php jāzin pirms tiek uzģenerēts html. Te Mysql kods, vajdzetu lai ta $hurrdurr vertiba ir vienada ar value un panemas no active img ;) Kā tas ir domāts paņemas? Ja kods ir tavs, tad jau to sen bija jāpaņem, pirms vēl izvada lai atrādītu... Bet laikam es ko nesaprotu, nav šorīt domājamais:) Quote Link to comment Share on other sites More sharing options...
Sephy Posted September 9, 2011 Author Report Share Posted September 9, 2011 (edited) Panemas domats ta lai PHP nolasa kurš IMG tags ir ar klasi active pašlaik un lai $hurrdurr panem to vertibu taja bridi kas ir pie active. Edited September 9, 2011 by Sephy Quote Link to comment Share on other sites More sharing options...
briedis Posted September 9, 2011 Report Share Posted September 9, 2011 Uj, neko nevar saprast. Tu gribi izmantot bildi kā linku, padodot get parametru vai? Quote Link to comment Share on other sites More sharing options...
Sephy Posted September 9, 2011 Author Report Share Posted September 9, 2011 Ja ir iespejams butu labi ;) Quote Link to comment Share on other sites More sharing options...
briedis Posted September 9, 2011 Report Share Posted September 9, 2011 <a href="index.php?id=10"><img src=".."/></a> Kāpēc nevar šitā? Quote Link to comment Share on other sites More sharing options...
Sephy Posted September 9, 2011 Author Report Share Posted September 9, 2011 Varet jau var, bet ka lai saliek kopa ar MySql vari ludzu paradit? ;) Quote Link to comment Share on other sites More sharing options...
briedis Posted September 9, 2011 Report Share Posted September 9, 2011 Klau, nu labāk pamācies php pamatus: http://www.tizag.com/phpT/ Kaut kā negribas rakstīt visu tavā vietā... 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.