-
Posts
840 -
Joined
-
Last visited
-
Days Won
1
Everything posted by gristoi
-
it is because you are only expecting the first parameter ("one") to be passed in the function function writeValue(array $value) { foreach($value as $output) { print $output.PHP_EOL; } } <?php writeValue(array('one','two','three','four')); .
-
Im going to hazzard a guess that the first column in your table is an id column? but not set to auto incriment, post the table struture
-
youve got an extra field in your insert: VALUES( '','$cl','$c','$cb','$cc')"; should be VALUES( '$cl','$c','$cb','$cc')";
-
nope I have no idea, try helping us to help you by posting your code. How can you expect people to help you with such a generic question
-
why not try using jquery to do what you need, i use a very good plugin called tipsy: http://onehackoranother.com/projects/jquery/tipsy/ does exactly what you need it to do
-
your mixing function and output. you need to do something along these lines: <?php function pokies_header_468_60_banner() { $output = '<div class="header_banner" >'; $output .= adrotate_group(16); $output .= '</div>'; return $output; } ?> then where you need to print it out: <?php print pokies_header_468_60_banner(); ?>
-
https://www.google.co.uk/search?q=php+sessions&aq=f&oq=php+sessions&aqs=chrome.0.57j5j0l2j62l2.3180&sugexp=chrome,mod=17&sourceid=chrome&ie=UTF-8
-
your lag is more than likely the delay in waiting from a response from the paypal api. it can take a good few seconds to get a valid response
-
Hi Guys, I have been playing around with zend 2 and all going well, as I am sure you are aware the documentation is still in its early stages and is incomplete in some places. The problem I have got is I am trying to find the correct way to populate the options of a select element from a model using the zend table gateway method. I got this working fine using doctrine, but decided to try the gateway way aswell, and I have to admit it has me a little stumped. Do any of you have an example of this, or a good reference for it? thanks
-
- zend framework 2
- form
-
(and 2 more)
Tagged with:
-
You will have to contact the developer of the plugin to get those answers. no one on this forum is going to be able to tell you what is happening without seeing the plugin code. If you want someone to fix it for you then you will be better posting in the freelance section
-
pretty much yeah, but if its only the title and link you need then do: SELECT title, link FROM ........
-
select * from _mytable where title LIKE "%John Doe%"
-
or you could move the left div under the right div in the html, i have come a cropper on this more than once. If you want something to float right next to something floating left then it needs to be placed before the left float: <div class="rightstuff"> <option selected>Please Choose</option> <option value="Mr">Mr</option> <option value="Mrs">Mrs</option> <option value="Mr">Ms</option> <option value="Dr">Dr</option> </select> <br> <input type="text" name="Firstname"><br> <input type="text" name="Middlename"><br> <input type="text" name="Lastname"><br> <?php echo $form1; ?> <!--$form1 can be found in "includeDOB.php" --><br><br> <input type="text" name="PassportNo"><br> <?php echo $form2; ?><br> <!--$form2 can be found in "includeDOB.php" --> <?php echo $form3; ?><br> <!--$form3 can be found in "includeDOB.php" --> <input type="text" name="Nationality"><br> <input type="text" name="Issuecountry"><br><br> <!-- NEXT OF KIN INFO v --> <input type="text" name="Fullname"><br> <input type="text" name="Address"><br> <input type="text" name="Postcode"><br> <input type="text" name="Relationship"><br> <input type="text" name="Mobilenumber"><br> <input type="text" name="Daytimephone"><br> <input type="text" name="Eveningphone"><br> <input type="text" name="Email"><br><br> <!--TRAVEL INSURANCE DETAILS--> <input type="text" name="Company"><br> <input type="text" name="Policynumber"><br> <input type="text" name="Underwriter"><br> <input type="text" name="Emergencynumber"><br><br><br></div> <div class="leftstuff"><h1>Personal Information</h1><br> <!--PERSONAL INFORMATION --> Title:*<br>First Name:*<br>Middle Name:<br>Last Name:*<br>Last Name:*<br>Date of Birth:*<br><br><h1>Passport Details</h1><br>Passport Number:*<br>Date of Issue:*<br>Date of Expiry:*<br>Nationality:*<br>Issue Country:*<br><br><h1>Next of Kin Information</h1><br>Full Name:*<br>Address:*<br>Postcode:*<br>Relationship:*<br>Mobile Number:*<br>Daytime Phone:<br>Evening Phone:<br>Email Address:<br><br><h1>Travel Insurance Details</h1><br>Insurance Company:<br>Policy Number:<br>Medical Company Name:<br>Emergency Medical Contact Number:<br><br><br><span class="bottomtext">I have read and agree to the <a target="_blank" href="http://planetcruise.co.uk/about-planet-cruise/terms">terms and conditions</a></span> <input type="checkbox" name="checkbox"> <input type="submit" value="Submit"><select name="Title"></div>
-
So, I have been playing round with using doctrine for a while now and have it in some basic projects, but i decided to go back and have an in depth look into what it can do. Ive now decided to switch to symfony 2 as my framework of choice and am looking into what doctrine 2 can do in more depth. One thing i have been trying to get my head around is the many to many relationship within doctrine. I am starting to build a recipe system and am working on the relation between recipe and ingredients which gave me 3 entities, recipe, recipeIngredient and ingredient. The reason i cannot use a direct many to many relation is because i want to store two additional columns in the join table ( unit and quantity ) for each ingredient. The problem i am having at the moment is that the entities persist ok, but the recipe_id in the join table is not inserted. The ingredient saves fine and the ingredient_id is stored as expected. I have tried everything i can think off and been through every thread and website looking for an answer . I am sure it is something completely obvious that i am missing. Please help, below is the code i have so far: <?php namespace Recipe\RecipeBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; /** * @ORM\Entity * @ORM\Table(name="recipe") * @ORM\HasLifecycleCallbacks() */ class Recipe{ /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\OneToMany(targetEntity="RecipeIngredient", mappedBy="recipe", cascade= {"persist"}) */ protected $ingredients; /** * @ORM\Column(type="string") * @var string $title * */ protected $title; /** * Constructor */ public function __construct() { $this->ingredients = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Add ingredients * * @param \Recipe\RecipeBundle\Entity\RecipeIngredient $ingredients * @return Recipe */ public function addIngredient(\Recipe\RecipeBundle\Entity\RecipeIngredient $ingredients) { $ingredients->setRecipe($this); $this->ingredients[] = $ingredients; return $this; } /** * Remove ingredients * * @param \Recipe\RecipeBundle\Entity\RecipeIngredient $ingredients */ public function removeIngredient(\Recipe\RecipeBundle\Entity\RecipeIngredient $ingredients) { $this->ingredients->removeElement($ingredients); } /** * Get ingredients * * @return \Doctrine\Common\Collections\Collection */ public function getIngredients() { return $this->ingredients; } /** * Set title * * @param string $title * @return Recipe */ public function setTitle($title) { $this->title = $title; return $this; } /** * Get title * * @return string */ public function getTitle() { return $this->title; } } and recipeIngredient /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\ManyToOne(targetEntity="Recipe", inversedBy="ingredients") * */ protected $recipe; /** * @ORM\ManyToOne(targetEntity="Ingredient", inversedBy="ingredients" , cascade={"persist"}) * */ protected $ingredient; /** * @ORM\Column(type="string") * @var string $quantity * */ protected $quantity; /** * @ORM\Column(type="string") * @var string $unit * */ protected $unit; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set quantity * * @param string $quantity * @return RecipeIngredient */ public function setQuantity($quantity) { $this->quantity = $quantity; return $this; } /** * Get quantity * * @return string */ public function getQuantity() { return $this->quantity; } /** * Set unit * * @param string $unit * @return RecipeIngredient */ public function setUnit($unit) { $this->unit = $unit; return $this; } /** * Get unit * * @return string */ public function getUnit() { return $this->unit; } /** * Set recipe * * @param \Recipe\RecipeBundle\Entity\Recipe $recipe * @return RecipeIngredient */ public function setRecipe(\Recipe\RecipeBundle\Entity\Recipe $recipe = null) { $this->recipe = $recipe; return $this; } /** * Get recipe * * @return \Recipe\RecipeBundle\Entity\Recipe */ public function getRecipe() { return $this->recipe; } /** * Set ingredient * * @param \Recipe\RecipeBundle\Entity\Ingredient $ingredient * @return RecipeIngredient */ public function setIngredient(\Recipe\RecipeBundle\Entity\Ingredient $ingredient = null) { $this->ingredient = $ingredient; return $this; } /** * Get ingredient * * @return \Recipe\RecipeBundle\Entity\Ingredient */ public function getIngredient() { return $this->ingredient; } }
-
Ajax Function Won't Work With Mysqli Object
gristoi replied to programming.name's topic in Javascript Help
firstly look at using jquery to make your ajax calls. is a lot cleaner and tried and tested, secondly turn your php error checking on in your result.php and see what is killing the script. are you definitely using mysqli and not mysql? -
this will give you everything you need to start coding in php with minimal effort: http://www.wampserver.com/en/
-
if your uncommenting dll's then i can presume you are using a windows machine. Why not try a couple of alternative server stacks that have everything in place for you. Zend server community edition comes with phpmyadmin pre configured for you, and WAMP is alos a good server to use.
-
do you have mysql installed on your machine?
-
I Need Some Guidance On Getting A Relational Db To "come Together"
gristoi replied to FoxRocks's topic in MySQL Help
you would just join the employee and licence tables aswell using the employee table as the reference, so something like this ( a bit rough but you should get the gist of it SELECT Emp_ID, Cal_Date, a.Area_Name, shift_ID, Stat_ID, [b]l.licence_type[/b] FROM schedule s INNER JOIN area a ON s.Area_ID = a.Area_ID [b]JOIN Employee e ON s.Emp_ID = e.Emp_ID JOIN licence l on l.Lic_ID = e.Lic_ID [/b] ) -
I Need Some Guidance On Getting A Relational Db To "come Together"
gristoi replied to FoxRocks's topic in MySQL Help
best you read up on a few sql and join tutorials, the mysql website is a good repo to work through. 'schedule s' is declaring an alias for schedule, so instead of typing schedule.fieldname i can just refer to schedule through its alias s, you can call the alias anything you want as long as it has meaning. And yes, now your tables are joined you can pull any fields from either table. Hope this helps -
I Need Some Guidance On Getting A Relational Db To "come Together"
gristoi replied to FoxRocks's topic in MySQL Help
You join the tables by their relation using joins, see below for an example. If you need any more info then let me know SELECT Emp_ID, Cal_Date, a.Area_Name, shift_ID, Stat_ID FROM schedule s INNER JOIN area a ON s.Area_ID = a.Area_ID -
<script type="text/javascript"> $(document).ready(function(){ $('.dateclass').each(function(index, value){ $(this).datepicker(); }); }); </script> try wrapping it in the document.ready
-
Php Calcuator Cant Find Error Keeps Giving Me Same Output
gristoi replied to Nerock's topic in PHP Coding Help
well 3 is less than 100. so it will always stop there. u should use logic like if result is > 93 and <= 100 then its an A+ else if result is > 88 and <=93 its an A -
have a quick look at this. there are certain reserved words in mysql. using the escapes allows you to use them as column names, but this is discouraged. https://dev.mysql.com/doc/refman/5.5/en/reserved-words.html
-
try $putmsg = insert("messages", "`id`,` title`, `content`, `to`, `from`, `date`", "1, '$subject', '$message', '$to', '$u', '$date'");