Hi,
I have been having trouble searching through a MySQL table, trying to find entries with the character (UTF-16 code 200E) in a particular column.
This particular code doesn't have a glyph, so it doesn't seem to work when I try to paste it into my search term. Is there a way to specify characters as their respective code point inst...
I'm tumbled with a problem!
I've set up my first check constraint using MySQL, but unfortunately I'm having a problem. When inserting a row that should fail the test, the row is inserted anyway.
The structure:
CREATE TABLE user (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
uname VARCHAR(10) NOT NULL,
fname VARCHAR(50) NOT NULL,
l...
I'm trying to store a 12/24hr (ie; 00:00) clock time in a MySQL database. At the moment I am using the time datatype. This works ok but it insists on adding the seconds to the column. So you enter 09:20 and it is stored as 09:20:00. Is there any way I can limit it in MySQL to just 00:00?
...
I downloaded and installed MySQL 5.1.47 for OS X 10.6 using the DMG archive:
mysql-5.1.47-osx10.6-x86_64.dmg
I also installed MySQL.prefPane and MySQLStartupItem.pkg. MySQL.prefPane is a Preference Pane. The problem is, whenever I attempt to start/stop MySQL from the Preference Pane, System Preferences just hangs. It runs at about 50%...
I may seem to be a bit wordy at first but for the hope it will be easier for all of you to understand what I am doing in the first place. I have an uncommon but enjoyable activity of collecting as many species of wood from around the world as I can (over 2,900 so far). Ok, that is the real world.
Meanwhile I have spent over 8 years com...
Hi,
i have an SP like
BEGIN
DECLARE ...
CREATE TEMPORARY TABLE tmptbl_found (...);
PREPARE find FROM" INSERT INTO tmptbl_found
(SELECT userid FROM
(
SELECT userid FROM Soul
WHERE
.?.?.
ORDER BY
.?.?.
) AS left_tbl
LEFT JOIN
Con...
Is there a statement that can drop all stored procedures in MySQL?
Alternatively (if the first one is not possible), is there such thing as temporary stored procedures in MySQL? Something similar to temporary tables?
So far, for both tasks, I seem not to find any answers although there were people asking for those in other forums.
Than...
How to select all the tables from multiple databases in mySql..
I am doing the following steps but not able to achive the goal.
<?php
$a = "SHOW DATABASES";
$da = $wpdb->get_results($a);
foreach($da as $k){
echo '<pre>';
print_r ($k->Database);//prints all the available databases
echo '</pre>';
$nq = "USE $k->Database";//trying to sele...
Hi all,
I got a Table which has two fields: Point, and Level,
with some sample data as follows:
-----------------------
Point | Level
-----------------------
10 | Level 1
20 | Level 2
30 | Level 3
40 | Level 4
Suppose that there is a user who has 25 points,
to find the Level in which this user is i...
Currently im just using something like:
in the DB Table:
access: home,register,login
and then in each page:
if(!Functions::has_rights('content'))
{
Functions::noAccess();
}
is there more efficient way to do it, php & MySQL? i may want to gain access even to several parts a page, for example: user can read a page, but doesnt ...
I have a table with 3 fields:
id
datestart
dateend
I need to query this to find out if a pair of dates from a form are conflicting i.e
table entry 1, 2010-12-01, 2010-12-09
from the form 2010-12-08, 2010-12-15 (edited, typo)
select id
from date_table
where '2010-12-02' between datestart and dateend
That returns me th...
I am trying to build a website with mysql and php. This is the first site I have attempted so I want to write a little plan and get some feedback.
The site allows users to add some text in a text field as a “comment”. Once the comment has been entered into the site it is added to the database where it can be voted for by other users.
W...
Hello,
After using stackoverflow for weeks i am just addicted by its system and the "badges" system. Is it possible to create a simple Q&A board with this concept or is there any tutorials ?
...
I have a "server" table which has a column named 'SN' in mysql, when do query to retrive servers with some sns from 'sn1' to 'sn10000', we can:
select * from server where sn in ('sn1','sn2','sn3',...'sn10000');
If there is only one sn in 'sn1'-'sn10000' which not exists in database, then the query above will retrive 9999 rows of resul...
Hello!
How do i get the actual max length of a specified column in php?
For instance, this table:
id - int(11)
name - string(20)
I want in php to select the maximum number of characters that a field can have, like
SELECT length(name) from table1
and it should then return 20 (since its the maximum number of characters for that field)...
This is part of my code:
$con = mysql_connect("localhost","username","passs");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $con);
if(mysql_num_rows(mysql_query("SELECT name FROM xbox_user WHERE name = '$user'"))){
// Code inside if block if userid is already there
$result = mysql_q...
I have to do something like this
insert into object (name, value, first_node) values ('some_name', 123, 0)
@id = mysql_last_insert_id()
insert nodes (name, object_id) values ('node_name',@id)
@id2 = mysql_last_insert_id()
update object set first_node=@id2 where id=@id
Is it possible to make it simpler?
What if I want to insert more pa...
hey guys
i need to query my database and find results :
mysql_query("select * from ".ALU_TABLE." where username like '%$q%' or name like '%$q%'");
if i have a name in my table such as Book and i enter book in search box it wont show the Book
i need to query my database as not to be case sensitive.
...
MySQL has a nice feature (although non standard) which allow to query resultsets' limit, offset as
SELECT * FROM TABLE LIMIT M, N;
Is it created by MySQL? or Postgres?
...
Hi,
It's possible to know if a MySQL server is overloaded (with PHP), and if it's overloaded show a static page (something like Twitter's fail whale)? How can I do it?
Thanks!
...