By real pagination i mean something like this when in page 3:
<<Previous 1 | 2 | {3} | 4 | 5 |...| 15 | Next>>
By Next and Previous buttons i mean something like this when in page 3:
<<previous Next>>
Performance wise im sure the Previous and Next Buttons are better since unlike the real pagination it doesn't require over-querying ...
When I replace
$ordering = "apples, bananas, cranberries, grapes";
with
$ordering = "apples, bananas, grapes";
I no longer want cranberries to be returned by my query, which I've written out like this:
$query = "SELECT * from dbname where FruitName LIKE '$ordering'";
Of Course this doesn't work, because I used LIKE wrong. I've ...
New to SQL. I'm looking to create a IT asset database. Here is one of the tables created with php:
mysql_query("CREATE TABLE software(
id VARCHAR(30),
PRIMARY KEY(id),
software VARCHAR(30),
key VARCHAR(30))")
or die(mysql_error());
echo "Software Table Created.</br />";
This is the output from the browser when I run the script:
...
I am retrieving an encoded url via querystring. I need to pass it again to the next page. When I retrieve it the first time, using $_REQUEST['url'], only the slashes are decoded, e.g:
http://example.com/search~S10?/Xllamas&searchscope=10&SORT=D/Xllamas&searchscope=10&SORT=D&SUBKEY=llamas/51%2C64%2C64%2CB/browse
Th...
Can you read out the name of a PHP constant from a database and use it inside of a php variable, to display the value of the constant for use in a menu?
For example here's what I'm trying to accomplish
In SQL: select menu_name AS php_CONSTANT where menu_id=1 the value returned would be L_HOME which is the name of a CONSTANT in a php co...
I have turkish character problem in mysql database when adding content with tinymce from admin panel.
Charset is:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9"" />
How can I solve this?
Thanks in advance
...
So This part of my code:
print_r($_SESSION['T']);
$T = array_values($data2);
print_r($_SESSION['T']);
Outputs this:
Array ( [0] => NZL ) Array ( [0] => ENG [1] => NZL )
That line is the first time $T is declared. As far as I can tell there should be NO reason for $_SESSION['T'] to gain an entry and its definitely causing me probl...
I am using ob_start()/ob_flush() to, hopefully, give me some progress during a long import operation.
Here is a simple outline of what I'm doing:
<?php
ob_start ();
echo "Connecting to download Inventory file.<br>";
$conn = ftp_connect($ftp_site) or die("Could not connect");
echo "Logging into site download Inventory file.<br>";
ftp_...
What happens to a php script which goes like this?
class FooException extends Exception
{
public function __construct() {
throw new FooException;
}
}
It's probably same as
while (TRUE) {
new Exception();
}
It simply time outs when execution time is exceeded, or fails with some fatal error?
...
While working on an existing Drupal site I've noticed a strange glitch that causes any PHP operator with > in it to act like a ?> tag. This is happening in in Drupal pages that I create that have a 'Input Format' of 'PHP code'.
For example this line of code
foreach($array as $key => $value){
results in a very broken page that prints o...
I have a form field that uses some Javascript to format user input 'price' field from say 1000 to 1,000.00 in real time before the form is submitted ..when I submit the form some PHP is reading the data and printing the results
Javascript bit is num = num.substring(0,num.length-(4*i+3))+','+
PHP bit is 'price' => number_forma...
I want PHP to randomly create a multi-dimensional array by picking a vast amount of items out of predefined lists for n times, but never with 2 times the same.
Let me put that to human words in a real-life example: i want to write a list of vegetables and meat and i want php to make a menu for me, with every day something else then yest...
Hey everyone,
I read a book awhile back called PHP Design Patterns and Practice, and ever since then I have been using design patterns whenever I think they are needed. However it just occurred to me that maybe most companies do not use design patterns very often for PHP, or at all. What I was wondering is, do most companies use design ...
OK, so that's maybe not the best title, but I don't know exactly what I want to do, so, please, hear me out.
I've used Windows pretty much all my life although I played with Linux on several occasions. At work everyone does web development with php on Windows using the same IDE and stuff.
I would like to experience the powerful Linux c...
Is it possible to create and manage multilingual webpage by TangoCMS?
I know that the AdminCP can be switched to another language than english (if it's translated and available).
But is there a language switcher for front-end?
Thanks.
...
Hi Everyone!
Ok so I got this piece of vendor software that they said should be run on an apache php server and MySql database.
I didn't have either of those so I put it on a PHP IIS server and I converted the code to work on SQL server.
ex.
mysql_select_db -> mssql_select_db
(among other things)
So I have the following code in a php...
I'm having a look at the date_sunset function in PHP and have met an issue that I find a bit strange. I have this piece of code:
$sunset = date_sunset(mktime(0, 0, 0, 5, 14, 2010),
$format, // Format
55.596041, // Latitude
12.992495, // Longitude
90, // Zenith
...
I'm having trouble figuring out how to query every item in a certain category and only list the newest 10 items by date. Here is my table layout:
download_categories
category_id (int) primary key
title (var_char)
parent_id (int)</pre></code>
downloads
id (int) primary key
title (var_char)
category_id (int)
date (date)</pre></code>
...
<?php
echo (2884284 >> 16), '<br>'; // = 44
echo ((2884284 >> 16) & 0xFFFF), '<br>'; // 44
from the above i got 44
so how can i retrive from 44 to 2884284 ???
...
I'm currently developing a support system for a university. The system is written in PHP and I would like to be able to get a current list of software and basic computer information on a computer. Basically when one of the faculty or staff creates a ticket from our web interface, I would like to have a Java Applet or similar that could b...