Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'array'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 16 results

  1. I'm running PHP files of example 2 from my computer and I got those following errors across pages. An error occurred in script 'D:\XAMPP\htdocs\ex2\html\views\home.html' on line 14: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given Array An error occurred in script 'D:\XAMPP\htdocs\ex2\html\shop.php' on line 32: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given Array An error occurred in script 'D:\XAMPP\htdocs\ex2\html\sales.php' on line 20: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given Array An error occ
  2. having problem with my form: created checkbox using array; then I want to save the value of the array to the database
  3. Hi everyone. I'm trying to echo the values of an array inside HTML's <option> tag. The following should be echod: <option value="Moose Jaw,SK,Canada">Moose Jaw,SK,Canada</option> <option value="Prince Albert,SK,Canada">Prince Albert,SK,Canada</option> <option value="Regina,SK,Canada">Regina,SK,Canada</option> <option value="Saskatoon,SK,Canada">Saskatoon,SK,Canada</option> The code I attempted was: <!DOCTYPE html> <html> <body> <?php $sk=array("Saskatoon","Regina","Moose Jaw", "Prince Albert"); sort($sk); forea
  4. I have a form like the one below which is posted to processForm.php, and the user can dynamically add more with jquery. <input type="text" name="subject[ ]" /> <input type="text" name="grade[ ]" /> <input type="text" name="year[ ]" /> <input type="text" name="subject[ ]" /> <input type="text" name="grade[ ]" /> <input type="text" name="year[ ]" /> <input type="text" name="subject[ ]" /> <input type="text" name="grade[ ]" /> <input type="text" name="year[ ]" /> Please How can i access those arrays from subject[], grade[
  5. Hi, Can someone please tell me what the best way is to remove a key-value pair from a single-dimension array where you know the value but not the key. (In PHP). Any advice will be most appreciated. Thanks, Necuima.
  6. I've been banging on the following error for awhile and I cannot tell what is wrong, please help: Catchable fatal error: Argument 2 passed to ShapeFactory::Create() must be an array, string given, called in /home/content/14/11625314/html/AdvPHPwOOP/factory.php on line 22 and defined in /home/content/14/11625314/html/AdvPHPwOOP/ShapeFactory.php on line 11 I'm using PHP 5.3 thru goDaddy Here's the code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Factory</title> <link rel="stylesheet" href="style.css
  7. I am writing a little script to read files in a folder (photos) returning an array of file name and file size. Can mysqli handle a prepared statement inserting an array? Would be nice to insert 500 photo names at once rather than typing them all in. Ps.. Not for a public site, just a script i run on a home server to build a site. Tx
  8. Hello, everyone. I created a multidimensional array that consists of 4 music genres in which each genre has 3 artists(using strings as keys) who in turn have 4 albums each(string values), but when I iterate over the multidimensioal array with a foreach loop, only the first album(the 1st string value) is associated with the artist(the string key). My intention was to map multiple string values to each string key/index, and have an output as such. Artist: Miles Davis Albums: Kind of Blue, Bitches Brew, Sketches of Spain, Birth of the Cool. Here's the code: <?php $jaz
  9. Ref. p.164 "Creating Multidimensional Arrays" Wondering why I keep getting "Notice"s about "Array to string conversion". I think this is covered in the book but I can't seem to find the place right now (or, I'm being lazy). I'm using Notepad v. 6.3 with XAMPP v. 3.1.0.3.1.0 with PHP v.5.4.7 and testing in Firefox (latest). Here's the "error": -------------------------------------------------------------------------------------------------------------------------- Notice: Array to string conversion in C:\xampp\htdocs\test\multidimensional_arrays\books.php on line 49 PHP
  10. Version 0.5 page 157 Quote: "# protected/controllers/SiteController.php public function actions() { return array( 'page' => array('class' => 'CViewAction', 'defaultView' => 'about') ); } To change the layout used to encase the view, assign the alternative layout name to the layout attribute in that array." Larry, I understand the example, but not the last sentence. It doesn't seem to relate to the example. Can you please explain it in other words? Thanks.
  11. I have a question, inspired by the "Random Quotes" mini-application, used as an example of writing to a file and reading from a file, in Chapter 11 of this book. The "read from file" part of this application picks a random quote from an array, and outputs it to a web browser. I want to figure out the simplest way to improve this script, so that the random quotes that it outputs are not repeated, as long as there are quotes left in the file. For example, the script has output the array element # 0. I want it to remember that the element # 0 has been output, and the next time to o
  12. Hello every one may some one can help me in this issue. When I use Literal syntax for Array like this: var name = ['name1', 'name2', 'name3', 'name4']; alert(name[2]); it return to characters in Array, but when i use it like this way: var names = ['name1', 'name2', 'name3', 'name4']; alert(names[2]); it return to the name3 at full not just one character on it. So my question is, there any point i miss to learn about this technique, or it could be problem in language ?
  13. I've read through the book, and now I'm working through it bit by bit; I am so hung up on this one subject that I need to ask for some clarification. In script 2.7 I'm working through arrays, and how to indicate strings, etc. On p. 64 the box on the right says that multi-dimensional arrays can also come from an html form- and since this is what I want to figure out how to create, I thought I would try to write the correct syntax for this to understand it thoroughly. Here's the code- a simple form that has check boxes and then sub check boxes; I realize this might be a bit more compl
  14. What is the fastest and easiest way to move the fetched data into an array using prepared statements? Everything I do seems ad-hoc. ... we bind results in two variable $col1 and $col2 ... $x = 0; $myarray = array(); while(mysqli_stmt_fetch($stmt)){ $myarray[$x]['col1'] = $col1; $myarray[$x]['col2'] = $col2; $x++; } ... Now we have a multidimensional array $myarray (what I want). However, if I have more variables seems a little inconvenient to repeat over and over again... I wonder if there is any way faster or better.
  15. I want to convert an XMLList into an Array (not an ArrayCollection). I do understand that an ArrayCollection is actually only a wrapper around an Array & at the heart of an ArrayCollection is in fact an Array. At this stage I can convert the XMLList into an ArrayCollection like so: testInfo = event.result.node; // testInfo is an XMLList myData = new ArrayCollection(mx.utils.ArrayUtil.toArray(testInfo.LoadType)); // myData is an ArrayCollection. Testing (component implementation), the only way I’ve been able to access the content (stripped of start & end XML tags) is like so:
  16. Hello This is an application of page 302, my variant exercise Been trying for the last two days to get the arguments sent by an object which calls a method, to an array which is in that method, and said array only gets the first of the arguments, as if it were a single scalar variable and not an array. UPDATE Someone solved the issue for me. The problem was that I was not passing the array into the object. I have to create the array, put the elements in there and then This is the code that sends the arguments require_once 'vehicle.php'; require_once 'Motorbike.php';
×
×
  • Create New...