If you go to this page on our website:
http://www.divethegap.com/scuba-diving-programmes-dive-the-gap/dahab-divemaster-training.html
The buttons at the bottom that say 'Beginner' 'Open Water Diver' etc....
They take you to another page where you have a series of options and can book.
We would like it so that rather than have to navigat...
What is wrong in this code?
$sql = "SELECT * FROM blogs WHERE blog_id = $'blog_id'";
$result = mysql_query($sql);
$rows = mysql_fetch_array($result);
$content = $rows['blog_content'];
echo $content;
The error is : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\jo...
In most other OO languages it would be sacrilege to have each function receive a single associative array of Objects rather than enumerating each in the method signature. Why is it acceptable and commonly used in most popular frameworks for both of these languages to do this?
Is there some justification beyond wishing to have concise m...
I've been bored lately and I want to start a new project. I was looking at a website mentioned in a different question (http://www.grapevinegame.com/), and I thought the map and how it plots a point based on someone's IP (I assume) is pretty nifty. I want to do something like that, but I have no idea how it's done. I know you can get lat...
Hello!
I'd like to make a htaccess file, which can make a good structure for my websites.
My .htaccess is now:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$
RewriteCond %{REQUEST_URI} !/admin
RewriteRule ^(.*)$ index.php?q=$1 [QSA]
(based on Sombat's comment, and about 30 try :P)
And I want t...
<script type='text/javascript'>
$(document).ready(function() {
$("#specific_consultant_yes").click(function() {
$('.specific').show('slow');
$.post("<?php echo $this->url(array('controller'=>'appointment', 'action' =>'available'),'default',true)?>",{app_date:$("#App_date").val(),consultant:$("#Consultants").val()} ,function(data){
$("...
Hello
keyword = house
SELECT * FROM products WHERE description LIKE '%house%'
This query also returns records having keyword, for example, courthouse, but I want to look for house only. How do I search anywhere in the description for "house" only?
Thanks.
UPDATE
just for more clarification ..
actually house, can be at
- the...
I have these two adjacent lines of code:
<td><?php echo __('Product', 'wpsc'); ?>:</td>
<td><?php echo __('Quantity', 'wpsc'); ?>:</td>
And these translations in the .po file
msgid "Product" // Translates
msgstr "Produkt"
msgid "Quantity" // does not translate
msgstr "Antall"
One string shows up translated on the webpage, the o...
Hi
I have an array that I would like to sort using a date field from a MySQL database.
Here is a sample of the array which is named news in my class:
[48] => Array
(
[id] => 14
[type] => 3
[updated] => 2010-04-17 13:54:42
)
[49] => Array
(
[id] => 15
[type] => 3
[updated] =...
I have a classified_id variable which matches one document in a MySql table.
I am currently fetching the information about that one record like this:
SELECT * FROM table WHERE table.classified_id = $classified_id
I wonder if there is a faster approach, for example like this:
SELECT 1 FROM table WHERE table.classified_id = $cla...
Hi,
I have an SQL table like this : sales(product,timestamp)
I want to display a chart using Open Flash Chart but i don't know how to get the total sales per hour within the last 12 hours. ( the timestamp column is the sale date )
By example i will end up with an array like this : array(12,5,8,6,10,35,7,23,4,5,2,16) every number is the ...
As the title says Im trying to do a simple insert, but nothing actually is inserted into the table. I try to print out errors, but nothing is reported.
My users table has many more fields than these 4, but they should all default.
$query = 'INSERT INTO users (username, password, level, name) VALUES (?, ?, ?, ?)';
if($stmt = $db -> prep...
I am just looking into using HTML Purifier to ensure that a user-inputed string (that represents the name of a person) is sanitized.
I do not want to allow any html tags, script, markup etc - I just want the alpha, numeric and normal punctuation characters.
The sheer number of options available for HTML Purifier is daunting and, as far...
I know that it's not possible to style any given PHP but I do know that it is possible to style the output HTML that the PHP provides you with. I was wondering if there was any method available for me to use that would enable me to style the output from my IF ELSE statement.
if ($result != false) {
print "Your entry has successfully...
I'm having trouble understanding why my code will not work asynchronously.
When running asynchronously the get_price.php always receives the same $_GET value even though the alert before outputs a unique $_GET value.
var arraySize = "<? echo count($_SESSION['items']); ?>"; //get items count
var pos = 0;
var pid;
var qty;
getPriceAjax...
I created a website with CakePHP, set up all of the permissions so guests could view
certain parts, and members only in certain areas, all with an administration panel.
Whenever I test this on my local testing server, it works perfectly, if I login I can view the content, if I logout, I can't. However, when I upload exactly the same f...
I have a query
public static function TestQuery(
$start=0,
$limit=0){
$sql = "
SELECT count(*) AS total
FROM db.table1
JOIN db.table2
ON table1.fieldID = {$fieldID}
AND table2.assigned = 'N'";
$qry = new SQLQuery;
$qry->query($sql);
if($row = $qry->fetchRow()){
$total = intval($row->total);
}
ret...
Hi folks. I have a Magento helper class I wrote that works wonderfully in 1.3. However, we're working on a new install of 1.4 and filtering by category won't work for some reason.
function __construct()
{
Mage::app();
$this->model = Mage::getModel('catalog/product');
$this->collection = $this->model->getCollection();
$this->...
I've made a simple guestbook mysql/php page. An entry is displayed if the approve column has a value of 1. For the adminstrator, I want to display either "message approved" or "not approved". Here's my code:
while ($row = mysql_fetch_array ($r)) {
print "<p>Guest:" .$row['name']. "</p>
<p>Date:" .$row['date']. "</p>
...
function convertDT($TS) {
$TS = strtotime($TS);
$TS -= date("Z");
$newTS = date("Y-m-d\TH:i:s\Z", $TS);
return $newTS;
}
echo "Good: ".convertDT('2010-04-20 01:23:45')."\n";
echo "Bad: ".convertDT('2010-31-20 01:23:45')."\n";
The second date returns: 1969-12-31T23:00:00Z
Why? Should this error?
...