Jump to content
php.lv forumi

IMG parametri un mysql


Sephy

Recommended Posts

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

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:)

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...