Jump to content

regoch

Members
  • Posts

    106
  • Joined

  • Last visited

Everything posted by regoch

  1. include ("admin/connect.php"); $id_slike=$_GET['id_slike']; $sql = mysql_query("SELECT * FROM slike WHERE id_slike=$id_slike"); foreach(($row = mysql_fetch_array($sql, MYSQL_NUM)) as $fieldNum=>$value) { echo $fieldNum++ . " -> " . $value; } I try you code but it show information from database about my picture, not the number of row. I get Image "information about picture" from 22 instead Image 3 from 22. Thanks for trying!
  2. that code show me "1 2 3 4 5 6 7 8 9 10 etc" number of rows in query. but I wont to get just number of selected row that sho picture (pictre on croatian is slika). not id_slike because picture are been deleted so id_slike don't work to this. Like on gallery when it shows Image 4 from 24 and when I click next Image 4 from 24 etc. number of rows work fine, but selected row is a problem.
  3. That first code work, problem is in second code!
  4. Hail! I try to get in my gallery like on facebook example "Image 3 from 24". I use: <?php include ("admin/connect.php"); $rezultat=mysql_query("SELECT * FROM slike ORDER BY id_slike DESC"); $broj_slika=mysql_numrows($rezultat); echo $broj_slika; ?> to get total row number, but i can't get single row number to work. I try with this: <?php include ("admin/connect.php"); $id_slike=$_GET['id_slike']; $sql = mysql_query("SELECT * FROM slike"); $rownr=0; while($row=mysql_fetch_assoc($sql)) { $rownr++; echo $rownr; } ?> This is database: CREATE TABLE IF NOT EXISTS `slike` ( `id_slike` int(11) NOT NULL AUTO_INCREMENT, `picture_name` varchar(150) COLLATE latin1_general_ci NOT NULL DEFAULT '', `picture_size` varchar(50) COLLATE latin1_general_ci NOT NULL DEFAULT '', `id_galerije` int(11) NOT NULL, PRIMARY KEY (`id_slike`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; Hope you get what is my problem!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.