mysql

Creating Object from Hibernate Mapping

If I have a mapping like this: <class name="Users" table="users"> <id column="id" name="id"> <generator class="native"/> </id> ... <set name="types" table="types" cascade="all"> <key column="user_id" /> <element column="type_name" type="string" /> </set> </class> How should the user object b...

Making A Secure Login

I have been trying to make a secure login for my site that I am developing. I just cant get it to work, I use MySQL databases with PHP. I can make the form to add the user and their info to the database but I can't seem to make it work with the login. What type of encryption is used with HTML <input type="password">? How do I keep t...

find the tables has binary data

How to find what are all tables has binary data and display the table name ? ...

mysql encoding issue with special character

Hi, I noticed my Rails app returns in place of double quotes and certain dashes, it returns a question mark character-- � Is there a way to update the table and replace them with original characters? Thanks! Amie ...

How to convert IPv6 from binary for storage in MySQL

Hello, I am trying to store IPv6 addresses in MySQL 5.0 in an efficient way. I have read the other questions related to this, such as this one. The author of that question eventually chose for two BIGINT fields. My searches have also turned up another often used mechanism: Using a DECIMAL(39,0) to store the IPv6 address. I have two ques...

Set binary data using setblob in mysql connector/c++ causes crash

I tried to use setBlob() as follows: class DataBuf : public streambuf { public: DataBuf(char * d, size_t s) { setg(d, d, d + s); } }; char b[20]; DataBuf buffer((char*)b, 20); istream stream( PreparedStatement* s = con->PrepareStatement("insert into mytable (mybin) values (?)"); s->setBlob(1, int rows = s->executeUpdate...

SQL - Most efficient way to perform this query?

Hi, I basically have three tables, posts, images and postimages (this simply contains the ids of both the other tables and allows more than one image in each post and each image to be reused in multiple posts if necessary). I'm trying to list the titles of all the posts, along with a single, small image from each (if one exists) I can ...

Can anyone explain the following PHP Code ?

Can anyone explain what the following PHP Code does function query($query_string) { if ($query_string == "") { return 0; } if (!$this->connect()) { return 0; }; if ($this->QueryID) { $this->free_result(); } if ($this->RecordsPerPage && $this->PageNumber) { $query_stri...

PHP / MySQL - Sometimes a blank entry gets added to a table

Hello, The code below allows my users to add an item ($site) to a table ($find). It works well. But every once in a while, it adds a blank value to the table in addition to the one the value the user adds. Any ideas why? Thanks in advance, John <? $find1 = urlencode($find); print "<div class=\"siteadd\"> <form action=...

Q:Technical requirements for Flash AS3 image manipulation and saving application

I am building a Flash AS3 application that allows users to modify images, and then submit-save them to a server. The user will then have the ability to log in and access these saved images in a thumbnail gallery. They can either delete an image or click a thumbnail to view it at original size. I am comfortable with the front end having ...

Select percentage of rows with different values

On a website I run, I let users rate the individual posts (3, 2, 1). I use the following SQL (in MySQL) to get the percentage of votes of each value: SELECT vote, COUNT(*) * t.factor AS pct FROM ratings JOIN ( SELECT 100 / COUNT(*) AS factor FROM ratings ) AS t GROUP BY vote LIMIT 0, 30; That works fine for calculating the per...

SQL where everything else

Consider two database tables, Reports and Reports_has_properties Reports ------ id_report 1 2 3 Reports_has_properties ---------------------- id_report property 1 red 1 big 2 orange 3 blue 3 tiny Problem: I only get only the reports with the property red, for example, but the query returns all ...

MySQL query to get non-data for unassigned dates

I have a table with weekly data that looks like: userID Site date ------ ------ ------ Smith Ferris Wheel 2009-07-13 Jones Outerspaceland 2009-07-13 LChar Ferris Wheel 2009-07-14 Smith Underworld 2009-07-16 Jones Fish Bowl 2009-07-17 Munson Go-Go Tech ...

What is the practical purpose of XML, that MySQL does not have?

I am interested in XML. I know it from Google's CSE. It is often a pain for me to manipulate 3000-rows XML files. This raises a question. Why does Google use XML, not MySQL, such that I need to manipulate large XML -files? ...

How to structure multiple users with multiple permission levels?

The site I am working with has a somewhat convoluted way with dealing with users and permissions. These are the user types: User Facility Approver Facility Admin Corporate Approver Corporate Admin Now there are also facilities, and that is where these permission levels come into play. Facilities are linked to users and user levels ...

Developing MySQL Stored Procedures with Intellisense?

Hello, i've looking for an IDE for MySQL with intellisense, which would help a lot. Any suggestions? Thanks! ...

Quick tips on relational database design for MySQL

Hi, I have a webapp I'm making that stores user information, and their preferences regarding the app. Is this something worth splitting into two databases? I was thinking one table "users" with fields "id, useridfromFacebook, facebookRealName" (so 1, 52052025295, Alex McP), and then have a table "preferences" with fields "id, useridfro...

What to consider before storing negative-dates in MySQL?

I'm working on a project now that will require me to enable users to store negative-dates in the database. These dates have the potential to span many thousands of years BC, and as late as 'Today.' I've worked on many projects that stored dates, but they were all relatively-recent dates, and none of them were ever negative (BC). What ty...

joining two tables based on cookie data

I am making a cookie based favorite system and need to join data from two tables based on the unique user id stored in the cookie so I can tell what items that use has marked as favorites. I know I need to do a JOIN but have not used them much and dont really have my head around them yet. Existing query that selects the items from the ...

mysql_connect error 500

I have narrowed down my problem to the mysql_connect call I am doing in PHP. It produces an error message. What would you suggest I should do to fix the problem with this error: Error Summary HTTP Error 500.0 - Internal Server Error The page cannot be displayed because an internal server error has occurred. Detailed Er...