mysql

Encoding problem in phpMyAdmin. Specifically with records containing russian text.

I'm making small module/plugin for my future CMS/Framework. I wanted it from begining to be with multi-language support. I set my new database to utf8_unicode_ci (I read that it is more accurate, then utf8_general_ci) Set my files to UTF-8 without BOM Every page has in head Content-Type: text/html; charset=utf8 When I register new us...

Problem in finding next / previous row in mysql

SELECT id ,MAX(status) AS status FROM Mail WHERE status < (SELECT status FROM Mail WHERE id = 1000) GROUP BY status ORDER BY status DESC LIMIT 1; I am using this query to find the previous row of the current row 1000.Here i am getting NULL values if i use the status column which is not unique.where as it gives proper values...

MySQL INSERT only if row doesn't exist, otherwise select the duplicate row.

I am looking for a statement that will try to insert a row into a table, but return the primary key of the duplicate row if one is encountered. One field in the table is the auto incrementing primary key, the other is unique. ...

MYSQL Connection String

Am new to mysql, I want to write a mysql connection code. Tried Code. string MyConString = "SERVER=localhost;" + "DATABASE=Database1;" + "UID=root;" + "PASSWORD=root;"; MySqlConnection connection = new MySqlConnection(MyConString); When i run the above code it is showing erro...

need MySQL optimization help

I have done some testing to Mysql server and I got some results 1) it says maximum table cahce size is 64 and you have 84 open table. so Increase table cache size. My question is why this much table is opened?? is it a failure in closing tables?? or it is like that?? ...

How to write optimized queries in MySQL ?

Are there any guidelines to write the optimized queries in MySQL ? ...

Cakephp, searchable behaviour help, returning empty results.

Hi, I'm using the searchable behaviour from the bakery. It is all set up correctly with no errors, so there is no problem there. However when preforming a search it returns no results. I'm at a loss as to why this is happening because of a lack of any errors. I think it might have something to do with initial set up or the indexing o...

SP problem in PHPMYADMIN

i got this error , When i execute this below sp snippet , DROP PROCEDURE get_DETAIL_STATE// CREATE PROCEDURE get_DETAIL_STATE(IN stateName VARCHAR(255)) BEGIN sELECT cFname,cLname FROM med_patient WHERE cState = stateName; END DELIMITER ; my updated snippet , DELIMITER ; CREATE PROCEDURE get_DETAIL_STATE(IN...

mySQL how to update and replace

I need to insert records, but if the records exist do a replace instead. Here is what I am currently using: $sessionDate = date("Y-m-d H:i:s"); foreach($tmpVP as $sessionVP) { $res = mysql_query("INSERT INTO sessions (sessionID,sessionDate,sessionVS,sessionVP) VALUES('$sessionID','$ses...

Accessing DB via function vs object, difference?

Possible Duplicate: PHP PDO vs normal mysql_connect So in my application, I accessed the database via a function named db_connect();. Quite simply, it fed the requisite login information and opened a database connection via mysql_connect and mysql_select_db. Now that I'm working, I have found that the lead programmer uses PDO...

How to store data to MySQL for array input

Hope my question is correct to the post. <form action="process.php?id=<?php echo intval($order['id']);?>" method="post"> <ul> <?php $sd = 'SELECT * FROM download WHERE pid IN ('.$order['pid'].') ORDER BY pid ASC'; // pid IN (3,4,5) $qd = $db->rq($sd); $no = 1; while($download = $db->fetch($qd)) { ?> <li> <?php echo $no...

Mysql join left help

I need a help with selecting the rows in a table depending on the status in previous table. Any help will be highly appreciated. ...

How to select a row for certain (or give preference in the selection) in mysql?

Need your help guys in forming a query. Example. Company - Car Rental Table - Cars ID NAME STATUS 1 Mercedes Showroom 2 Mercedes On-Road Now, how do I select only one entry from this table which satisfies the below conditions? If Mercedes is available in Showroom, then fetch only that row. (i.e. row 1 in above examp...

How to periodically push data to the user interface in php

hi, i need to implement a simple project using PHP and MySql in which i need to push data to the user's UI when some one else is updating the database, and i need to periodically do this too, so when some one else accessing the same table and modify it, another person who uses the UI can see the updates, sorry if i'm being silly but up ...

MySQL Fulltext Search, increase minimum character.

I'm trying to do MySQL fulltext search using the following query: SELECT * FROM files WHERE MATCH(title) AGAINST ($q) limit $limit The problem is, if any words under 4 characters are included in the search phrase than it ignores them. This is very bad for my search engine because a lot of possible things people will be searching for w...

'Unknown table' although it really exists

$query = mysql_query("SELECT company.*, factory.* FROM company FULL JOIN factory ON company.n_id = factory.n_id WHERE company.n_id = '$n_id' AND factory.n_id = '$n_id'") or die(mysql_error()); Above you see my query. It gives me Unknown table 'comp...

ajax product selector

Hello guys, i want to create a product selector like the one found here http://advisors.dell.com/advisorweb/Advisor.aspx?advisor=e539dfdf-439d-421c-8d4d-8a24a9ba314f&amp;c=us&amp;l=en&amp;cs=19 i know i'll probably use ajax , jquery, php , mysql but i dont know where to start. please help me :( ...

Synchronizing Access DB and MySQL

I've got a client who has a very large internal system using Access, which is used internally to handle virtually all company data. They want a web front-end to the customer data in that database, and would be running on a different server. Given the limitations on Access, the front-end would likely use MySQL. Which leaves the issue o...

Keeping an application database agnostic (ADO.NET vs encapsulating DB logic)

We are making a fairly serious application that needs to remain agnostic to the DB a client wants to use. Initially we plan on supporting MySQL, Oracle & SQL Server. The tables & views are simple as are the queries (no real fancy SQL), therefore the question: Use native DB drivers (MySQLDbConnection etc.) and encapsulate the logic of e...

get all the ips that are viewing my web page

Hello there ! What's the best way of getting all ip's that are curently viewing my web page and show them like a list (on another page) and update when a client is leaving or entering on my page ? And this using html ,php, javascrip , mysql , and stuff like this. ...