SHARE
TWEET

Untitled

a guest Apr 25th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`walkmydoggydog`.`pas`, CONSTRAINT `pas_ibfk_1` FOREIGN KEY (`vrsta`) REFERENCES `vrsta` (`sifra`)) in G:\vhost\polaznik18.edunova.hr\app\model\Pas.php:40 Stack trace: #0 G:\vhost\polaznik18.edunova.hr\app\model\Pas.php(40): PDOStatement->execute(Array) #1 G:\vhost\polaznik18.edunova.hr\app\controller\PasController.php(20): Pas::add() #2 G:\vhost\polaznik18.edunova.hr\app\model\App.php(47): PasController->add() #3 G:\vhost\polaznik18.edunova.hr\index.php(21): App::start() #4 {main} thrown in G:\vhost\polaznik18.edunova.hr\app\model\Pas.php on line 40
  2.  
  3. <div class="ui main text container segment">
  4.     <div class="ui huge header">New <?php echo App::config("nazivApp") ?></div>
  5.     <form class="ui form" method="post"
  6. action="<?php echo App::config("url") ?>pas/add/<?php echo Request::post("sifra") ?>">
  7.  
  8.         <div class="field">
  9.             <label>Ime</label>
  10.             <input type="text" name="ime"
  11.     value="<?php echo Request::post("ime") ?>" />
  12.         </div>
  13.  
  14.         <div class="field">
  15.         <label>Slika</label>
  16.         <input type="text" name="slika"
  17.     value="<?php echo Request::post("slika") ?>" />
  18.         </div>
  19.        
  20.         <!-- <div class="field">
  21.         <label>Vrsta</label>
  22.         <input type="number" name="vrsta"
  23.     value="<?php echo Request::post("vrsta") ?>" />
  24.         </div>
  25.          -->
  26.         <div class="field">
  27.     <label for="vrsta">Vrsta</label>
  28. <select name="vrsta" id="vrsta">
  29.     <option value="0">Choose</option>
  30.  
  31.     <?php foreach(Vrsta::read() as $vrsta): ?>
  32.  
  33.         <option
  34.  
  35.             <?php if(Request::post("vrsta") == $vrsta->id):?>
  36.                 selected="selected"
  37.             <?php endif;?>
  38.  
  39.                 value="<?php echo $vrsta->id ?>"><?php echo $vrsta->vrsta ?></option>
  40.                 <?php endforeach; ?>
  41. </select>
  42.  
  43. </div>
  44.  
  45.        
  46.     <div class="ui buttons">
  47.   <a href="<?php echo App::config("url") ?>pas/index"><div class="ui button"></i>Odustani</div></a>
  48.   <div class="or"></div>
  49.   <input type="submit" class="ui positive button" value="Dodaj" />
  50.  
  51. </div>
  52.     </form>
  53.     <?php echo $poruka ?>
  54. </div>
  55.  
  56.  
  57.  
  58. <!-- <label for="vrsta">Vrsta</label>
  59. <select name="vrsta" id="vrsta">
  60.     <option value="0">Choose</option>
  61.  
  62.     <?php foreach(Vrsta::read() as $vrsta): ?>
  63.  
  64.         <option
  65.  
  66.             <?php if(Request::post("vrsta") == $vrsta->id):?>
  67.                 selected="selected"
  68.             <?php endif;?>
  69.  
  70.                 value="<?php echo $vrsta->id ?>"><?php echo $vrsta->vrsta ?></option>
  71.  
  72.     <?php endforeach; ?>
  73.  
  74. </select> -->
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top