mysql

what mysql format should i use for these decimals? (Google Maps co-ords)

I have these two values i want to store: $a = '51.480092'; $b = '-2.589397'; ...

Data pagination with "saved" search

I'm creating a page that's a search result... When you're viewing one of the results, at the bottom of the page, I need to insert "Next result" and "Previous result" links, like a pagination... But from [I think] a saved search, right? How you people would do this? Obs.: I'll use CakePHP (PHP) and MySQL -- Update: The problem is not...

quick mysql query problem

sorry, i dont like to ask such instance specific questions but this is driving me MENTAL! there's gotta be something obvious i'm missing: table: |ven_name|varchar(150)|No| |ven_sd|varchar(90)|Yes|NULL |ven_details|varchar(3000)|Yes|NULL |ven_tel|varchar(30)|Yes|NULL |ven_email|varchar(50)|Yes|NULL |ven_address|varchar(300)|Yes|NULL |l...

MySQL: Finding rows with conflicting date ranges

Hi there, I'm writing an ad booking system for our site. Ads are booked in with a StartDate and EndDate field to indicate how long they're online for. When adding a new advert, I have a quick validation check to make sure the new ad doesn't clash with an existing ad that's booked into the same position. I thought I had it with this qu...

MySQL ORDER BY offset

In a MySQL query how would I select: all rows, ordered by column name those with name > 'f' should come first, then the rest alphabetically so I'd get G, H, …, X, Y, Z, A, B, C …, F. ...

mysql to excel generation using php

<?php // DB Connection here mysql_connect("localhost","root",""); mysql_select_db("hitnrunf_db"); $select = "SELECT * FROM jos_users "; $export = mysql_query ( $select ) or die ( "Sql error : " . mysql_error( ) ); $fields = mysql_num_fields ( $export ); for ( $i = 0; $i < $fields; $i++ ) { $header .= mysql_field_name( $export ,...

MySQL: Can the table comment length be increased?

I read the MySQL comment length questions on StackOverflow here: http://stackoverflow.com/questions/391323/table-comment-length-in-mysql http://stackoverflow.com/questions/2473934/how-to-increase-mysql-table-comments-length The first link suggests that it can be done and the second suggests it cannot. I don't know why there is this...

How to get MYSQL to show Zero results when left joining to self? (eg: Monthly Stats)

I have a table with typical statistics on page view and emails. An email creates a row and page view creates a row... I want to chart the page views and emails on a daily basis for the past 30 days (for example) so I need to show the day and the value... even if it ZERO. I cannot have missing days from my results or the chart breaks. ...

mysql_close(): supplied argument is not a valid MySQL-Link resource

Here's what I'm trying to do: I've got a db.php file that does all the db manipulation. It has 2 static methods, connect and deconnect. In my other file i simply use db::connect() and db::deconnect(). The mysql_close($con) in the deconnect method just doesn't know who $con is. Since I don't want to instantiate my class static is the ...

Drupal 6: getting random data from database

Hi friends, I spend few hours at google, but cant find :/ is it possible to get a random data from database with Drupal 6? appreciate helps!! thanks! ...

PHP and MySQL SELECT problem.

Trying to check if a name is already stored in the database from the login user. The name is a set of dynamic arrays entered by the user threw a set of dynamic form fields added by the user. Can some show me how to check and see if the name is already entered by the login user? I know my code can't be right. Thanks! MySQL code. SELECT ...

MySQL table_cache and Windows 2048 File Descriptor woes

Hi all, I have a hosting/MySQL configuration issue that I hope someone can help with. I currently have a server running MySQL 4.1 along with PHP 4.4.7 and Apache 2.2. I think the most important factor given my current problem is the MySQL install. This server has around 150 databases on it, and as far as I can see I’m running into is...

Symfony 1.4: Deleting a sfGuardUser

Hi, I'm having some trouble with the following... I have a sfGuardUser table set up normally, and it has a one-to-one relationship with a Profile table, which contains some additional user info. When a user wants to delete themselves from the site, I'd like to retain their info in the Profile table for various purposes BUT delete the ...

Database design: objects with different attributes

I'm designing a product database where products can have very different attributes depending on their type, but attributes are fixed for each type and types are not manageable at all. E.g.: magazine: title, issue_number, pages, copies, close_date, release_date web_site: name, bandwidth, hits, date_from, date_to I want to use InnoDB and...

Recursion in prepared statements

I've been using PDO and preparing all my statements primarily for security reasons. However, I have a part of my code that does execute the same statement many times with different parameters, and I thought this would be where the prepared statements really shine. But they actually break the code... The basic logic of the code is this. ...

Complex SQL query... 3 tables and need the most popular in the last 24 hours using timestamps!

Hey guys, I have 3 tables with a column in each which relates to one ID per row. I am looking for an sql statement query which will check all 3 tables for any rows in the last 24 hours (86400 seconds) i have stored timestamps in each tables under column time. After I get this query I will be able to do the next step which is to then c...

copying html page with mysql data in php

I am trying to copy a file into a folder called profile. I got that working, but I need the page to be .html. I also need data from MySQL to put in the .html page. How do I go about that? ...

MySQL ON DUPLICATE KEY UPDATE for multiple rows insert in single query

Hello All. I have a sql query where I want to insert multiple rows in single query. so I used something like: $sql = "INSERT INTO beautiful (name, age) VALUES ('Helen', 24), ('Katrina', 21), ('Samia', 22), ('Hui Ling', 25), ('Yumie', 29)"; mysql_query( $sql, $conn ); The problem is when I execute this query, I want to ch...

Mysql setting default value to be items auto increment key

Just doing a site which requires multiple items to be reordered by AJAX. When I create a given object in the database, I want to set the position column to the value of the rows' primary key upon creation. How would I do this please? ...

Dynamic jQuery popup with PHP

So I have dynamically generated content from a MySQL database and I pull it with php. To show what I mean look this example. Goto http://minecraftadmins.net/browse/ See Skin Preview? I want to make it so when you click it, it opens a jQuery popup with content generated from an external source (AJAX). I know how to make a popup. But it d...