Jump to content

PHP and MySQL HELP !!!


balkan7

Recommended Posts

i need help for this, look to the picture, Category and CD show to number, i need show me to charters, and checkbox, if checked show me 1 if not chacked show me 0, i need this, if checked show me NEW, if not checked nothing show!

soryy for bad english !!!

[img]http://www.prerodbalab.org/test/add.JPG[/img]

[img]http://www.prerodbalab.org/test/view.JPG[/img]

datebase.sql:
[code]CREATE TABLE `product` (
  `id` INT(250) NOT NULL AUTO_INCREMENT,
  `sifra` VARCHAR(25) NOT NULL,
  `naslov` VARCHAR(250) NOT NULL,
  `opis` TEXT NOT NULL,
  `kat_id` VARCHAR(25) NOT NULL,
  `cd_id` VARCHAR(25) NOT NULL,
  `novo` TINYINT(1) NOT NULL,
  `datum` VARCHAR(250) NOT NULL,
  `validen` TINYINT(1) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;


CREATE TABLE `product_kategorija` (
  `id` INT(25) NOT NULL AUTO_INCREMENT,
  `kategorija` VARCHAR(250) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;


CREATE TABLE `product_cd` (
  `id` INT(25) NOT NULL AUTO_INCREMENT,
  `cd` VARCHAR(250) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM;
[/code]
Link to comment
https://forums.phpfreaks.com/topic/27124-php-and-mysql-help/
Share on other sites

When you print out your database entries you would set something up like this:

[code]
<?php
echo "<td>
          CD";
  switch($database['cd']) {
      case 6:
          echo "DVD 1";
          break;
      case 7:
          echo "DVD 2";
          break;
  }
echo "</td>";
?>
[/code]

Anyway thats a really basic way...
Link to comment
https://forums.phpfreaks.com/topic/27124-php-and-mysql-help/#findComment-124006
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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