mysql

display tooltip on hover over text

How would I go about displaying a tooltip when the user hover overs some text? These text are keywords. I don't want to manually add these tooltip for each keywords. I am looking for a way to create a script of some sort to automatically do this either on the client side or server-side. When a user hovers over these keywords, and if the ...

How to let a user manipulate text (make it bold/italicized), before it is saved in a MySQL table?

Hello, Is there a way one can let a user manipulate text he/she may be typing via PHP? For example, the user may be able to make the text he/she has typed bold or even italicized. One can assume, that I am trying to get similar effects of this website. Is there a way to do this in PHP? I am trying to do this because once the user hits ...

mysql get non existing results

Using php and mysql, I have a table "subdomains" that contains subdomains for my application, depending of a category. subdomains - id, cat_id, subdomain Some categories have subdomain and others don't have. For those that don't have subdomain, I want the subdomain to be 'www'. Now in my subdomains table there are a few values, for exa...

what mysqli functions to use instead of mysql?

This will probably sound pretty dumb. I've got a mysql function containing the following... @mysql_connect() @mysql_select_db($databaseName,$link); mysql_query($sql,$link); mysql_error() mysql_fetch_array($result,MYSQL_ASSOC) mysql_num_rows($result) Can I just bung an i after mysql like this... @mysqli_connect mysqli_query($l...

C++ Windows Form Application Mysql Connection

I can't seem to figure out how to connect to mysql in my windows form application. I've installed all the proper libraries and have included them, thats not the issue. The issue is I can't find a tutorial on connecting to mysql. I've found some one console applications, tried them, but yet for some reason they do not work. I just need to...

What is the Algorithm for an ORM?

I've been digging around for an ORM to use in a php/mysql application. However none quite grab my attention past "hello world" tests. So, I decided to do some research and try to code my own custom ORM. However I haven't been able to find resources that explain at code level how to handle db relationships. The concept of how an ORM works...

rails joins conditions as hash

hi, Course.find(:all, :group =>:id, :order => 'updated_at DESC', :joins=> :students :conditions => { :students => { :first_name=>"John", :status => 1}}) looking this query, passing the conditions as a hash, there is a way to: construct a where :first_name not null? construct a where :first_name != "John"? ...

Proper MySQL character set/collation variables in my.cnf?

I'm trying to switch my site over to UTF-8 completely, so I don't have to deal with utf8_encode() & utf8_decode() functions. I have the collation of my tables set properly, and I'm temporarily using the query SET NAMES utf8 to override the my.cnf file. My question is — there are a ton of character set and collation variables in my.cnf,...

default a column with empty string

Is there a way, via a SQL statement, to ensure a column's default value is an empty string '' instead of NULL? ...

UTF8 characters not printed as such in Drupals HTML.

I am trying to debug a nasty utf-8 problem, and do not know where to start. A page contains the word 'categorieën', wich should be categorieën. Clearly something is wrong with the UTF-8. This happens with all these multibite characters. I have scanned the gazillion topics here on UTF8, but they mostly cover the basics, not this situat...

Trouble retrieving products under a complex category structure in PHP

Hello, I hope you guys can help me with this one. So, I have a products table and a categories table. The structure for the categories table is listed bellow. There will be about 20 categories with three or four levels deep. In order to get the category tree a wrote a recursive function and it is working fine. My new task is to displa...

MySQL: ERROR 1054 (42S22): Unknown column in 'where clause'

I'm doing some changes on a WordPress database. I need to replace the URLs in the GUID field on the wp-posts table with the URLs coming from another table called ebdurls. The description of the tables is as follows: wp_posts: the field type for the two fields I need are: ID -> bigint(20) unsigned guid -> varchar(255) And the table w...

How to create a list of seconds in MySQL

I have the following query: SELECT timestamp, COUNT(*) FROM table GROUP BY timestamp But some timestamps do not show up because there is no data. Here's an example 1:00:00 | 3 1:00:02 | 17 1:00:03 | 2 Notice that 1:00:01 is missing. Is there a way to make the 1:00:01 | 0 appear in the result? ...

In mysql is "WHERE a = 2 AND b = 'Wiliam'" the same as "WHERE b = 'Wiliam' AND a = 2"?

In mysql, does the order of the WHERE clauses affect the time that it takes the server to process the query? I know that the queries are compiled and optimized, but I don't know if that optimization changes the order of the WHERE clauses so in a hypothetic case it will take less time to process a query that first selects the results wit...

Merging result from 2 columns with same name and not over-writing one

I have a simple MySQL query like: SELECT * FROM `content_category` CC , `content_item` CI WHERE CI.content_id = '" . (int)$contentId . "' AND CI.category_id = CC.category_id AND CI.active = 1 Both tables have a column called configuration one of which gets overwritten in the query i.e only content_item.configuration is ret...

.NET C++ Windows Form Application Connecting To Mysql

nvm, I'll just keep trying or switch over to C# ...

How to give a user's question a URL based on it's ID in MySQL, so one may access it in the future?

For some reason, I just can't seem to get my head around this concept. Any advice/hints will be appreciated. As of now, I have this code: if(isset($_GET['ID'])) {//Check if ID exists in $_GET $ID = mysql_real_escape_string($_GET['ID']); //prevent sql injection $resc = mysql_query("SELECT Message, Title, Type FROM Discussion WHERE ID...

Maximum SQL Queries per page

This question probably has no definite answer, so if it's considered subjective and, let's say bad, please feel free to close it. Basically I am developing a pretty big web application (PHP), and it uses CakePHP. Right now it's under development and some things in the Database are really complex therefore lots of queries need to be made...

real_escape_string vs. prepared statements

is there any reason to use one over the other in terms of speed and safety? Thanks! ...

Dynamically Created Top Articles List in Django?

I'm creating a Django-powered site for my newspaper-ish site. The least obvious and common-sense task that I have come across in getting the site together is how best to generate a "top articles" list for the sidebar of the page. The first thing that came to mind was some sort of database column that is updated (based on what?) with ev...