mysql

Mysql syntax exception from jdbc

I'm trying to move the data from one table to another based on names which end with "@localhost", but while moving the data I'm getting an exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use n...

Redirect user to the last page on my pagination...

I know this sounds confusing: I have just built some basic prev/next pagination for mysql and i wanted to know, if the last page of my rows is .php?page=5 and someone puts .php?page=263 then i want to redirect them to .php?page=5 Any ideas on how to do this.. the info i currently have is, how many rows are returned after the LIMIT so i...

how to format date coming from MYSQL

Hi Simple question but i need it :) $query = "SELECT * FROM `set` WHERE ID = '$id'"; $result = mysql_query($query); $info = mysql_fetch_assoc($result); $frmdate = $info['date']; So far i tried $timestamp = strtotime($info['date']); $joined_date = date("j M. Y", $timestamp); but no luck ! "date" field in mysql is DATE data ...

How do I populate a jcombobox with information from a mySQL database?

Title says it all.. Basically the program takes customer information and dumps it in a database. In order to change information I want the user to be able to pick a customer name from a combobox, so the system can then call all the info out of the database on that customer. Accessing the database is fine, putting info in and changing it...

php encryption sql

I want a form where user can change password. I am able to encrypt a password, however when it is selected from the database(the original password say 'test') it does not recognise it. This is when the password has been encrypted in db. i am checking to see if the typed password in form matches the one in the db: SELECT * from table wh...

Is there a way to GUARANTEE non-blocking reads in MySQL?

I have tried the obvious "SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED", but my simple stored procedure still gets blocked while doing a SELECT MAX on a PRIMARY KEY while updates are going on (when running simultaneously with certain complex update transactions that I do not want to modify) -- ultimately running into Deadlock...

Monthly categories with MySQL DATE Type.

Hello, I'm building a mini news CMS where the news added are sorted using a DATE type column e.g. INSERT date_posted=NOW(), etc. I can then easily list out all the available months with: SELECT DATE_FORMAT(date_posted, '%M %Y') as date_posted. This makes the monthly categories list. The issue I'm having is with displaying all the news ...

mysql cross join not in?

Using a query like below you can fetch rows in which the color of the id is blue, purple, green, white, and black. SELECT t1.id, col FROM extra as e INNER JOIN your_table as t1 USING ( id ) CROSS JOIN your_table as t2 USING ( id ) CROSS JOIN your_table as t3 USING ( id ) CROSS JOIN your_table as t4 USING ( id ) CROSS JOIN your_table as ...

Improve this possible 5 joins SQL sentence

Hi everyone, I'm using MySQL 5, and I need to do this sentence to get the results. It's the first attempt when I think about it. I know there are several ways to improve it, but I want to get your opinions first: SELECT p.id, p.image, p.lat, p.lng, p.category_id, p2.title, p2.description, c2.name FROM place p LEFT JOIN place_tr...

Generating many nested lists using PHP and MySQL?

I've been looking around this site but could not find a good answer on how to create a menu with many nested lists. I personally don't know how to code in the PHP and MySQL to do this and I'm trying to learn the best way to do this. I'm a rookie. All I got created is the MySQL table called categories which is listed below. id | paren...

Python: advantages and disvantages of _mysql vs MySQLdb?

Two libraries for Mysql. I've always used _mysql because it's simpler. Can anyone tell me the difference, and why I should use which one in certain occasions? ...

mysql: see all open connections to a given database?

With administrative permissions im mysql, how can I see all the open connections to a specific db in my server? ...

Ruby/Rails/Mysql

I am on leopard. It comes with Ruby 1.8 & Sqlite3 pre-installed. I have updated ruby to 1.9.1 & added Mysql. Here's the problem. I cannot get the path to correctly point to ruby 1.9.1. I tried to update the sym-link to no avail. I am able to get into Mysql from the terminal but I cannot connect to the server through Ruby because Sqlite3 ...

Portforward SQL Server?

Hello I haven't done SQL in a while, so I need to freshen up on things. I have a SQL Database running on my computer, and my server is localhost. I made an app in VB.Net that connects to this database. Everything works fine and all, until I distrubute my app to another person. When they try to connnect it doesn't seem to work for them....

Large dynamic side-nav menus using PHP and MySQL?

What is the best way to display a large tree side-nav menu with many nested list levels using PHP and MySQL? How many tables should I use and how should I code the PHP? ...

MySQL CASE "Else Case When" is executing when the precondition is true - what am I missing?

I have a table that, due to the third party system we are using, sometimes has duplicate data. Since the model uses an EAV method there's no way to filter this the "right" way, so I am aggregating the data into a View - I know this is a data collection problem but it's easier for me to fix it on the display end than go through this syst...

Suggest Web Host for Java in windows environment

Hi, Please suggest the good and cheap web host with java language support in windows env. I am familiar with windows,apache tomcat,mysql,java and searching for best deal. ...

Json and Mysql problem

hi here is my code for json php include("connect.php"); $id = $_GET['lid']; function countRec($fname,$tname) { $sql = "SELECT * FROM `mail` WHERE confirmed = 'no' AND label_id = '". $id ."'"; $result = mysql_query($sql) or die ('test'); $num = mysql_num_rows($result); return $num; } $page = $_POST['page']; $rp = $_POST['rp']; $sort...

mySQL caching - Memory or Hard disk?

Hi all, I am working on a grid based treasure hunt like game in PHP , mySQL and I am trying to decide between two caching options. Game Description The user has a 1000 cell grid, clicking on some cells will have no effect, others will direct you to a "this item has been found!" page :)... many items are accessible via any of a number o...

library interposition with dlsym

I'm writing an interposition library to track the usage of some library functions in libc, such as open(), close(), connect(), etc. It works generally well on most of the applications. However, when I try it with PHP, using PHP's MySQL module in particular, none of the function calls to libc inside this module is been tracked (so no conn...