Building Array Of Difft Results For Return
I have 2 functions that I want to call from a subroutine, and then return their results; one result is an array, the other will be an array of arrays. The first will be the information about a product, $product, with values like $product['title'], product['id'], etc.
The second will be an array of arrays, each line of which contains information about an element of the product. I.e., $item[0]['title'], $item[2]['value'], etc. How would I best combine these so I can RETURN the total thing from the function, and then how would I refer to the parts in the calling code? For example, if I said Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
MySQL Results To Return Only One Value
For example, I have a column that has three different values, 1, 2, & 3. In the database, there may be over 500+ entries with one of these values assigned to it. How can I get MySQL to return just 1, 2, & 3 only once rather than several hundred times.
Query In PHP Won't Return Results In There's Only 1
$sql = 'SELECT `PageTitle` ' $sql .= 'FROM `Pages` ' $sql .= 'WHERE `PageID` = 1 LIMIT 0, 30' I have run this query in MySQL control panel and it works perfectly. When I try to do it via PHP I get no results. If I select all rows (i.e I don't specify a "WHERE") I get one fewer rows returned than there actually are.
Return Results On One Page
i have a search field on a .php page. i want to return the results on the same page i.e i dont want the action to point to test2.php but test.php which is were my search filed is sitting at the moment. how do i do this? i got this on my first page: <form method="post" action="test2.php"> Name: <input type="text" size="10" maxlength="40" name="name"> <input type="submit" value="Send"> </form> and this on the second: <?php $name = $_POST['name']; if ($name=="Friday") echo "Have a nice weekend!"; elseif ($name=="Saturday") echo "Tomorrow is Sunday!"; else echo "Please enter Friday or Saturday"; ?>
Return Search Results On Same Page
I'm struggling with this much longer than I think I need to, How do I make the results of a search display on the same page as the search, sort of beneath the 'submit' button? Thanks for helping out.
Building An Array Of Files
I'm working on a function to map a php project that's gotten a little unwieldly. I'd like to have a reference of all files like the output of the unix tree command, like this: .. |-- index.php | |-- menu.php | |-- content.php | |-- admin_page.php | | |-- admin_function1.php.inc | | |-- admin_function2.php.inc | | |-- admin_function3.php.inc | | `-- admin_subpage.php | | |-- admin_subfunction1.php.inc | | |-- admin_subfunction1.php.inc | | `-- admin_subfunction1.php.inc | `-- user_page.php | |-- user_function1.php.inc | |-- user_function2.php.inc | |-- user_function3.php.inc | `-- user_subpage.php | |-- user_subfunction1.php.inc | |-- user_subfunction1.php.inc | `-- user_subfunction1.php.inc | |-- orphan_page.php `-- deprecated_page.php I have a function that can create such text output ( or close enough ) from an array structure like this: Array ( [0] =./index.php [1] =Array ( [0] =./clients.php [1] =Array ( [0] =./login_function.inc [1] =./client.php [2] =./client_new.php [3] =./client_edit.php ) [2] =./inventory.php [3] =Array ( [0] =./login_function.inc [1] =./inventory_item_add.php [2] =./inventory_item_remove.php ) [4] =./daily_report.php [5] =./weekly_report.php [6] =./monthly_report.php [7] =./catalog.php [8] =Array ( [0] =./login_function.inc [1] =./catalog_item_add.php [2] =./catalog_item_remove.php ) [9] =./orders.php [10] =Array ( [0] =./login_function.inc [1] =./view_order.php [2] =./order_new.php [3] =./order_edit.php ) [11] =./invoices.php [12] =Array ( [0] =./login_function.inc [1] =./view_invoice.php [2] =./invoice_new.php [3] =./invoice_edit.php [4] =./invoice_print.php [5] =./invoice_email.php ) ) [2] =./clients_old.php [3] =./old_inventory.php.....
Building An Array From A Database
Just a quick questions. I'm retrieving two fields from a database one being "id" and the other "name". I am currently using this to load the results $i=0; while($row = $db->fetchArray($results)) { nameArray[$i] = $row; $i++; Which fetches the results by Association and gives me these results: Array ( [0] => Array ( [id] => id1 [name] => FirstName ) [1] => Array ( [id] => id2 [name] => SecondName ) ) is there some way to modify the code so I get this result: Array ( [id1] => FirstName [id2] => SecondName ) It seeem like it should be possible but I just can't seem to work it out.
How Do I Return 10 Results Per Page Using SELECT Statement?
I'm wasn't sure whether to post this under the PHP or under the MySQL section of the forums. Since most people (I'm assuming) who write PHP script, also use MySQL, I thought I'd stick with PHP. I'm rather new to both PHP and MySQL and I'd be very grateful to anyone who can help me solve a problem I'm having at the moment. First, I'll give you an introduction to my little project... I'm developing a database in MySQL that is used to store the song titles of all the MP3s I have on my PC. I've written a basic search feature that works well. The user has 2 options: Either he can type a special "!ALL" "parameter", that I made up, to return all the songs in the database or the user may enter a few characters in the textbox and select "song title" or "artist" etc. from a dropdown to search for a specific song title or artist etc.. Hope you are following so far? Say for example the user presses submit after typing "!ALL" to return all the song titles - there could be hundreds of results. What I want to do now is display 10 results on a page, then on the next page another 10, etc. (like a real search engine!). I've tried doing it with the LIMIT statement, but like I said I'm new to this and discovered that that is not the right way of going about it. My question is this: how would I go about returning 10 matches per page? Do I use hidden form fields? What would the SELECT statement look like? What would the PHP scripting look like to setup the "back" and "forward" navigation between the result for the search?
Mysql Doesnt Return All Results Of A Query
I have an sql query like this: SELECT column FROM table WHERE column1="3" AND column2="1" This query works perfectly if i run it in the command line, to be exactly it return two results. But if i run it from php i just get the first of the two results. Any ideas? Mysql 4.1.8 php 5.0.3 I have a second problem. But its more of a question. if i run the foreach loop on an array like this array("id" => "78"), then it splits 78 up in 7 and 8. Now you say its stupid to use a foreach for this array. But in the function there i use it the array could also be two dimensional. Is this behavior normal? I looked in the php manual but found nothing.
Building Multi Dimensional Array
I am trying to build a multi dimensional array from an unsorted array. I have an array made up of the lines in a text file, each line is a comma seperated set of fields. The first two fields are the lines id and it's parents id; eg Line ID, Parent ID, Data 1, 1 , one 2, 2, two 3, 3, three 4, 1, four 5, 4, five 6, 1, six 7, 2, seven I am trying to build a multi dimensional array so that the final array would look like; -- one ---- four ------ five ---- six -- two ---- seven
Building An Array And Passing The Variables Through Pages
I have a form that inserts a variable and then shows the variable where needed. simple... i think. I have it working, but I can't seem to add elements to the array. Also anytime I go to another section I lose the information. from the variable. here is the basic bit of code used. Code:
Sorting Sql Results In An Array Using Things Outside The Array To Sort Them?
I'm using PHP to connect to a database full of place names, and their associated post codes, latitude and longitude on the earth. A user types his or her post code into a form, plus a distance (in miles), and the script looks for other area codes (first half of the post code) within that distance. I can do that fine, but the results are ordered alphabetically by postcode, and I want to order it by the distance. Problem here, is that the distance isn't part of the array taken from the database, it takes the latitude and longitude of the area it's on in the while loop, and calculates the distance between the user's post code and that one, but it's not part of the array, so I can't sort the array using it. How can I sort it? Can I add the calculated distances to the array, and sort it using sort()? If yes, how do I add them to the array? Here's the page, just to explain better what the script does: http://navimaker.org/ed/owain/results.php?postcode=gl15&distance=34 Mess around with the postcode and distance vars. I'd put the source on here too but I'm doing all this over SSH and can't copy & paste very easily .
Return Row # With Each Array Value?
Does anyone know how to output an array from a MySQL query, but tack on an incremental value to the end of each variable that represents the row number? I'm looking for something like this: // query stuff here // Now I output the query result: while ($fetch = mysql_fetch_array($result)) { echo ""eBody(CURRENT ROW NUMBER)=".$fetch["quoteBody"].""eDate(CURRENT ROW NUMBER)=".$fetch["quoteDate"].""eWriter(CURRENT ROW NUMBER)=".$fetch["quoteWriter"]."";} Of course the (CURRENT ROW NUMBER) references are what I'm looking for. The way I have it now, PHP outputs an ampersand-delimited string representing all fields in the database. Output looks like this now: "eBody=This is the body of the quote"eDate=08/11/01"eWriter=Mike& I'd like to find out how to make it look like this: "eBody1=This is the body of the quote"eDate1=08/11/01"eWriter1=Mike& You get the idea. Anyone know how to do this?
About Return A Array
When I write this codes: <? function r_array(&$array){ for($i=1;$i<5;$i++) { for($j=1;$j<5;$j++) { $array[i][j] = "d"; } } } r_array($array2); print_r($array2); echo $array[1][1]; ?> it display in the brower like this: Array ( [i] =Array ( [j] =d ) ) And this means $array[1][1] can't be used. And what's the problem? I want return a 2D array and use it like $array[1][1],what should I do?
Function() Return Array?
If i put print instead of $output[] it works. But if I do count $output I get 0. why does it do that? i cant print $output[0] or [1] PHP Code:
Return Array From A Function..
I have a function which querys MySQL table i have implemented. I used to have it all in the html page however decided to make my code better and continue learning by writing this as a seperate function with parameters passed into it, and then calling the function from the html page. The issue here however is while the function works, when i want to display parts of the data at a later stage in html page it does not work. The code that fetches the values for displaying is in the function. While i am trying to display the info in the array inside the html page within tables. I presume its because my function does query and then does this $data = mysql_fetch_array( $sql ); //all inside the seperate function and then i have to return $data as a means of passing it into the HTML page when i call the function. Therefore when i am inside the html page there is actually a $data that exists?? That is what i have deduced as being the problem however i can seem to find out how to return this $data or catch it in the html page!
Return Array From Function
I want a function that is able to return a array. But the php-manual says that you can’t. Ex. of what I want: function arrFunc() { $returarray = array(“some”,”arrray”,”stuff”); return($returarray);}
How To Return A 'sub-array' Of A Multidimensional One
I have a multi-dimensional associative array, and I'm interested in searching the array for a given key, and returning the 'sub-array' or value associated with this key. for example: Code: $array = array( 'A'=>1, 'B'=>2, 'C'=>ARRAY( 'A2' => 'FRUIT', 'B2' => 'VEGGIE', 'C2' => ARRAY( 'MEAT1' => 'BEEF', 'MEAT2' => 'CHICKEN' ) ) ); I want to retrieve the array under the key 'C2'. I have tried to 'search' the array so that its internal pointer is pointing at this element, then using 'current', but that doens't work: Code: array_key_exists( 'C2', $array ); var_dump( current( $array ) ); I've also tried a small variation of the above in order to get the reference to C2 rather than a deep copy: Code: array_key_exists( 'C2', $array ); var_dump( $array[key($array)] ); I would actually prefer to get a reference into the array rather than a copy.. I guess I'm really stuck on the 'search' part of the mutlidimensional array.. Surely there's a better way (built-in function) than iterating every element and comparing the key?
Howto Return 'best' Key From An Array?
I have an array of seller items, sorted by price. Sometimes, however, the item described is incorrect--and so I need to parse through the description and if it contains certain badwords I need to skip to the next key to perform the same test. An array may contain many keys, yet I need to narrow it down to one.
Can I Return Array With A Function ?
i try to build a fetch_col function i give in parameter the query result and the number of the col which i want to return i fill an array with result in the function but i don't know how i can return the array i try : Code:
How To Return And Array In Php Web Services?
I'm a beginner in php web services I need to make a web service using php and consuming in delphi 7. I need make a function that return an array, I follow the SOAP examples but it does't works
Trying To Return Mysql Array Items From Function
I am writing a calendar script which returns events, holidays etc.. from MySQL for days with events. This was easy BUT then I tried to return multiple events on some days and thats where I am stuck. I found some examples of returning arrays from functions from functions but they all use some form of array(Ƈ',ƈ',Ɖ') and then use a for loop... I am using mysql_fetch_array so this does not seem to work... First, here is some of the code from the function where I am returning the value: PHP Code:
Attempting To Return Values From Array From W/in A Function
I am attempting to read through a text file & then update an HTML page table w/ the output from the text file (ie; statusing by table). What I want the code to do is read through the file, look for a line that matches a couple of strings, next is loop through the file from that match to 30 lines searching for a "score" from, then store that score; and then look for the next algorithm (8 of them) run & score. What I get is an array w/ only the most recent array entry. I have tried several things; return(), array_push(), php manual, and a more than a few days searching online for a similar example. Code example below; function fraction_0($file,$log) { while (! feof($file)) { $line = fgets($file,512); if (ereg($_GET[what],$line) && ereg("_A_0",$line) && ereg("Request ID",$line)) { print ("$log".htmlspecialchars($line)."<BR>"); for ($i30 = 1; $i30 < 30; $i30++){ $line = fgets($file,512); if (!ereg("returned best solution",$line)){ if (ereg("Score from run", $line)){ print ("$log".htmlspecialchars($line)."<BR>"); $alg_score = explode(" ", $line, 512); if (ereg($alg_score[6], 1)) { $alg_array = array("alg0_1" =$alg_score[8]); print "score for alg 1 is $alg_array[alg0_1]<BR>"; }elseif (ereg($alg_score[6], 2)) { $alg_array = array("alg0_2" =$alg_score[8]); } elseif (ereg($alg_score[6], 3)) { $alg_array = array("alg0_3" =$alg_score[8]); } elseif (ereg($alg_score[6], 4)) { $alg_array = array("alg0_4" =$alg_score[8]); } elseif (ereg($alg_score[6], 5)) { $alg_array = array("alg0_5" =$alg_score[8]); } elseif (ereg($alg_score[6], 6)) { $alg_array = array("alg0_6" =$alg_score[8]); } elseif (ereg($alg_score[6], 7)) { $alg_array = array("alg0_7" =$alg_score[8]); } elseif (ereg($alg_score[6], 8)) { $alg_array = array("alg0_8" =$alg_score[8]); } print "<table border="1"><tr><th>Alg 1</th><th>Alg 2</ th><th>Alg 3</th><th>Alg 4</th><th>Alg 5</th><th>Alg 6</th><th>Alg 7</ th><th>Alg 8</th></tr>"; print "<tr><td>$alg_array[alg0_1]</td><td> $alg_array[alg0_2]</td><td>$alg_array[alg0_3]</td><td> $alg_array[alg0_4]</td><td>$alg_array[alg0_5]</td><td> $alg_array[alg0_6]</td><td>$alg_array[alg0_7]</td><td> $alg_array[alg0_8]</td></tr>"; print "</table>"; } } else { print ("$log".htmlspecialchars($line)."<BR>"); $i30=30; } } } }
How To Return Number Of Distinct Elements In PHP Array
I need to structure a table differently depending whether the card is available only with one inside (e.g. blank) or whether it's available with two (e.g. blank & happy birthday). I have an SQL query returning the message, so I want to check whether there is more than one distinct value in an array. The array exists already (e.g. $row['message']). Does anyone know a suitable function for this? Like, count_distinct_results... Originally I started off struggling with a separate SQL, which didn't seem to return the expected number: $query4="select count(card_msg) from xyz where image_id='$id2'"; $result4=mysql_query($query4) or die ("Error in query " . mysql_error()); $row4=mysql_fetch_assoc($result4); )
Looping Through An Array And Using The Results.
function build_menu() { $all_li = create_list_items(); $menu = '<ul id="navbar">' reset($all_li); while($li = each($all_li)) { $menu .= $li; } $menu .= '</ul>' echo($menu); } I'm trying to move through each item in the #all_li array and add it's contents to the $menu variable. $all_links is filled with string values from the function create_list_items(). I tried (above) using each(), but the output from the function is "ArrayArrayArray" and this has me confused. I think it's giving me this because each() creates an array which includes key values (yes?), which means each() is not the method I need to use. Can anybody advise me on a method I can use to loop through the $all_links array and add each string to the $menu variable? So far I've tried a for loop, foreach, even attempted an array_walk(), but haven't had any success.
Populating Array With Mysql Results
I'm returning a result set of one field in a table, and want to populate an array with the results. I can't for the life of me figure out a simple way to do this without using mysql_fetch_array() to cycle through the results, append that to a var, then explode that into a var and pass that. PHP Code:
Displaying Array Results In Table
I'd like to display the results of an array in a table format with the Alias, Alias Destination & Username as column headings & the results underneath. PHP Code:
Store Mysql Results Into An Array
i just started using php. i've used it before as a maintainer. fun stuff. well now i'm the writer. i want to abstract all the DB commands away from myself and all other developers. so i'm writing a function to query the php database from all users of the database and store them into an array as a return value so that i can seperate my database code from my html creation code. 1. is there a way to put all my database functions into a php file and include that file into all my other php pages? similiarly to a #include in C++ or a import package name in Java? 2. my code to run down the fetched results and store them into an array doesn't seem to be working the way i want it to. if i print out the results from the mysql returned fetch the data is fine. however the array seems to print out "Array[elementnumber]" instead of the value. Code:
Evaluating Array And Skipping Certain Results
I'm having a brain freeze on this. I have a script where I am reading the contents of a file into an array. I have that up and working with no problem. Then I'm exploding the array using while ($line = fgets($fd, 4096)) { $arrayData = explode("-", trim($line)); } Works fine. But what I want to do now is evaluate arrayData[2] to see if it contains the integers "00" (that's zero zero) and if it does, I want it to skip that entry. I know I need to set it up with if arrayData[2] == "00" { But I'm drawing a blank on how to get it to skip this entire line in the final results. There may be multiple instances of this happening in each file and I want to skip them all.
How Do I Search Two-dimiensional Results Set Array
Here's the pertinent code to get the SQL results. It is generated by dreamweaver adn I'm trying to learn to code php so I don't depend on DW to do it for me. $query_rsSummary = "SELECT sid, Count(wid) FROM plotting GROUP BY sid"; $rsSummary = mysql_query($query_rsSummary, $tableG) or die(mysql_error()); $row_rsSummary = mysql_fetch_assoc($rsSummary); How do I search the array to see if a certain "sid" has an entry in the array?
Taking SELECT Results And Turning Them Into An Array()
Does anyone know how take a mysql select statement and have the results placed into an array? I am returning 1+ rows and want to place those rows into an array so I can run a foreach() for each row and then run another foreach() for each column for each row? Code:
How To Make An Array With Query Results? (Postgresql)
Need help making an array with query results: $value = $_POST['text']; $pg = pg_connect('dbname=test user=user password=secret'); $query = "SELECT column FROM information"; $result = pg_query($query); *** how to create array with $results ***
Query Array, Sort Results And Display In Seperate Tables
The problem I have it breaking out the results and displaying them (broken out) alphabetically in seperate tables. For instance, I have generated (bookmarked) tables, one for each letter (A-Z) and want to display all recordsets with say, last name beginning with "A" in one 2 column table, "B" in another 2 column table, and so on... each table would have two columns (with 2 background colors alternating), each cell containing values of one recordset. Even more tricky is if I have an odd number of cells, still generating the last cell with empty values (for asthetics). And can anyone say "sort" (yes, I am nuts)? The ability to sort the whole mess by any column value. I have looked at freeware and other third part apps, but they can only do what I already can do (mine is actually cleaner) but not as complicated.
Array Results Output On Online As Opposed On Separate Lines
How do i get to echo details on oneline as opposed to the next line. $car=array("red", "green", "white", "blue", "orange"); foreach $car as $color) { echo "$color<BR/>"; I dont want the results on separate lines but on the same line with commons...
Pushing Data Into A Multi-dimensional Array From Mysql Results
First, A result array I'd want to get could look like this: $chart['chart_data'] = array ( array ( "Region A", 10,12,11,15,20,22,21,25,31,32,), ); The first is "Region A" and the rest is just int's that I'd pull from the db, so to set it I'd do this: $chart [ 'chart_data' ][ 0 ][ 0 ] = "Region A"; But the problem is when I want to insert the data in the while loop (like the 10,12,11,15...), I've tried array_push but it's not working, maybe it doesn't work with multi-dimensional arrays? Anyways, here.'s what I tried, the following inside the "while" to loop the mysql results with mysql_fetch_assoc: while($r=mysql_fetch_assoc($res)) { $chart [ 'chart_data' ][ 0 ][ 0 ] = array_push($chart['chart_data'][0][0], $r['wght']); // the above line is where I have problems ^^ } What I want is on each loop to insert the fetched data inside the array so that it gives what I gave first at the top, but what I've written above doesn't work, it gives me a warning saying "first argument must be an array" which seems to be one, but anyway, anybody know how to do this?
Function Doesn't Return If "load" Is An Array Value
I have created a simple function to load an array with name / value pairs, and return the array. Most of the time it works as expected, but one particular name / value pair causes the function not to return. No errors are reported. My system details: OS: Windows XP SP2 ("Windows NT OFFICE 5.1 build 2600" reported by phpinfo) Server: XAMPP for windows (apache) PHP Version: PHP Version 5.1.4 The function: Code:
Search Brings Back Different Results Or Sometimes No Results
The problem Iv got is that when searching the site - it brings back different results or sometimes no results. For example: "i026", "i 026" and "026" do not bring back results for "I-026" which is the correct model number. Any ideas on how to make it search more variations or of a "Did you mean... I-026" script?
Building PHP 4.3.3 With GD 2.0.11
All libraries were installed (precompiled) This is FreeBSD 5.1 installed zlib, installed jpeg and png libraries (in default directories) GD 2.0.11 source is in /usr/gd-2.0.11 (compiled and installed flawlesly) I configured PHP with the following: ../configure --with-gd=/usr/gd-2.0.11 --with-freetype-dir=/usr --enable-g d-native-ttf --enable-gd-imgstrttf --with-jpeg-dir=/usr --enable-png- dir=/usr -- with-zlib --with-mysql --with-apxs2=/usr/local/apache2/bin/apxs When configure came to reading jpeg header, it gave me an error about libjpeg.a I need GD, because I want to use coppermine (picture gallery) on my "future" web site. Contents of config.log file (from here to end of message): This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. configure:1618: checking host system type configure:1706: checking for gcc configure:1819: checking whether the C compiler (gcc ) works configure:1835: gcc -o conftest conftest.c 1>&5 configure:1861: checking whether the C compiler (gcc ) is a cross-compiler configure:1866: checking whether we are using GNU C configure:1875: gcc -E conftest.c configure:1894: checking whether gcc accepts -g configure:1927: checking whether gcc and cc understand -c and -o together configure:1942: gcc -c conftest.c -o conftest.o 1>&5 configure:1943: gcc -c conftest.c -o conftest.o 1>&5 configure:1948: cc -c conftest.c 1>&5 configure:1950: cc -c conftest.c -o conftest.o 1>&5 configure:1951: cc -c conftest.c -o conftest.o 1>&5 configure:1978: checking how to run the C preprocessor configure:1999: gcc -E conftest.c >/dev/null 2>conftest.out configure:2059: checking for AIX configure:2086: checking if compiler supports -R configure:2101: gcc -o conftest -g -O2 conftest.c -R /usr/lib 1>&5 configure:2159: checking for ranlib configure:2187: checking whether ln -s works configure:2212: checking for gawk configure:2212: checking for mawk configure:2212: checking for nawk configure:2246: checking for bison configure:2246: checking for byacc configure:2290: checking for flex configure:2324: checking for yywrap in -lfl configure:2343: gcc -o conftest -g -O2 conftest.c -lfl 1>&5 configure:2367: checking lex output file root configure:2388: checking whether yytext is a pointer configure:2407: gcc -o conftest -g -O2 conftest.c -lfl 1>&5 configure:2431: checking for working const configure:2485: gcc -c -g -O2 conftest.c 1>&5 configure:2510: checking flex version configure:2650: gcc -o conftest -g -O2 conftest.c 1>&5 /var/tmp//ccQc5UBs.o: In function `main': /usr/php-4.3.3/configure:2646: undefined reference to `pthread_create' configure: failed program was: #line 2632 "configure"...
Building PHP 4.2.x
I was able to build php 4.0.*, (apache 1.3.26, solaris 8) and now want to install the newest version. Here's my issue, i'm runing confgure with: configure --with-apxs=/opt/apache/bin/apxs it seems to make it through this part fine, then i run make and my output is below. I don't want mysql support or anything. The same steps work when i do it with php 4.0.* though, so i'm confused. Code:
Building Url From Variable
I am trying to do the following: I want to assign a string to a variable then use that variable in an HREF as follows: <html> <head> <title>Test Doc</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php $var = "123.htm"; ?> The variable $var has a value of:...
Building Diary
I am building a month view of a diary and am enlisting the help of some previously created script. Although I understand how the calendar1.class creates the table, I am not being clever today and stuck on how to get the data into each day with an event/appointment. The diary entrys need to be identified by thier cal_id in a SQL table and there is a start and end time to each entry. In each day I need to show the summary of the event and the start time and end time. Can you point me in the right direction? Here is the calendar class: PHP Code:
Building XML From MySQL
I'm getting 'Call to undefined function: new_xmldoc()' when I try the following script. Does this mean that new_xmldoc is not a valid function. I could not find it in the manual. Here is the script: PHP Code:
Building A Class
i'm building a class for a upload form and i want to know whats the best way to handle error in a class, like if someone enters a bad email or a bad password whats the best way to stop the class from keep going. Code:
Creating A Building Map
I am looking to impliment a digital maping system similar to google maps where I can take floorplans of my company and map assets to certain locations and search for them after. like google-maps meets an office people-finder so that when you are looking for printer 23-541-a you can just put it in the interface and it will bring up the map of where the asset is in the company.
Building An 'if' Condition On The Fly.
I would like to create the condition of the 'if' function on the fly, meaning : $condition="$a > $b"; // this variable is a string that contain the 'if' condition .... $a=1; $b=1; if ($condition) { ... } I hope you see what I mean here... In fact, I try to build the condition of the 'if' function so at the end it 'virtually' looks like this: if ($a > $b){ ... } Of course, here that does not work because $a=$b. Code:
|