Do I need to escape my object data if I'm serializing for mysql injection?
ie:
class Object
{
public $description;
}
$obj = new Object();
$obj->description = mysql_real_escape_string("this is my crazy string with lot's of bad // characters");
$data = serialize($obj); // <-- $data will be stored in DB
or will this suffice:
class...
I'm trying to find out what type of membership which is the type_id has with a count of cars that have this membership
Here are my tables
create table car_hire
(car_id char (5) primary key not null,
car_reg varchar (15) not null,
car_make varchar (20) not null,
car_model varchar (20) not null,
car_year date not null,
type_id char (5) ...
I'm not even sure if this is possible. I am using Kohana framework(ver 2.3). I have 2 separate databases. One called 'employees' and another called 'tracker'. The databases are used in 2 different websites. I want to eliminate a table in the tracker database called 'csr', which contains identical employee data, and link the tracker to th...
I have a script that polls a MySQL database (Nagios, specifically) for the date/time of events. I want to count how many events occur in each hour based upon all of the data my script returns.
Here is what the results look like: (each on their own line)
2010-03-01 03:20:26
2010-02-28 19:07:26
2010-02-28 00:50:37
2010-02-27 17:07:35
...
Lets say a member is displaying 10 images by default but a link will display the rest of the users images by having them slide down when a user clicks a link.
So my question basically is I want to be able to display all the users images buy having them slide down when a user clicks on a link <a>. How would I be able to tackle this prob...
I've just checked out the ON DUPLICATE KEY UPDATE for MySQL.
Here is an example query.
$query = 'INSERT INTO `activities`
(`id`,
`hole_id`,
`name_id`,
`start_depth`,
`end_depth`,
`start_time`,
`end_time`
...
Lets say I display the first 10 images of a user in the MySQL database and then I run a second query to display the rest of the other users images from where the last query left off. How would my second query look like?
Here is how my first query below looks like.
SELECT *
FROM images
WHERE images.user_id = '$user_id'
LIMIT 0, 10
...
I was wanting to know how I get the last two ids from the table based on certain conditions
for example, if today is 1st July, I want to get the id of record for today and then the id of the record before this.
Please note that the id for the previous record might be different, as this is sorted by date, so previous_id = current_id - 1...
I had a feeling that searching domain names taking time more than as usual in mysql. actually domain name column has a unique index though query seems slow.
My question is do I need to convert to binary mode?? say md5 hash or something??
...
I have a select list like the following inside of a form.
<select name="0[voicemail]" >
<option value="" selected="selected"></option>
<option value="800">800</option>
<option value="801">801</option>
<option value="802">802</option>
<option value="803">803</option>
<option value="805">805</option>
<option value="807">807</option>
<opt...
In my case, every "item" either has a property , or not. The properties can be some hundreds, so I will need , say, max 1000 true/false bits per item.
Is there a way to store those bits in one field of the item ?
...
Is it possible to set the number of rows that a table can accommodate in MySQL ?
I don't want to use any java code. I want to do this using pure mysql scripts.
...
What is the difference between signed and unsigned in MySQL? And what does signed and unsigned mean?
...
Is there a way in MySQL table to assign a default when a value that is not in the enumeration is assigned to that field?
CREATE TABLE `comments` (
`status` enum('approved','moderated','unmoderated') NOT NULL DEFAULT 'unmoderated'
);
Works if status is not defined at creation, but if you set it to something not in the enumeration or ...
I am having trouble with a query used by a google suggest type of feature in a CMS
The first link is the query that is provided by and used within the CMS itself, and works flawlessly.
The second is my modification, which works fine but when certain input is entered, such as 'b', generates a syntax error, and I can not understand why.
...
Hi All,
CREATE TRIGGER membership AFTER INSERT ON jos_config5
FOR EACH
ROW
BEGIN
INSERT INTO jos_config4( identity_guid, UserID,
STATUS , original_conf_path, output_file_path, time_of_process, time_of_start, time_of_completion, status_message, Projectname )
VALUES (
'12', '345', '753', '34', '45', 'NA', 'NA', 'NA', 'User has not sta...
Of course, I could go into mysql console and type the Function. But what if I want to store it for future use? What do I do?
...
I have 4 tables each with different columns but they all have one column in common. This is an integer identifier column. So I will have some integer x, and I want all the rows from all 4 tables that have this one id column equal to x.
Ive tried something similar to:
SELECT table1.col1, table2.col2 FROM table1 LEFT JOIN table2 ON table...
Hi,
I want to create the Trigger which calls a php script and also passes parameters to php
CREATE TRIGGER trigger_test AFTER Update ON table1 where status_message = "done"
FOR EACH ROW
BEGIN
\! echo "php /Email.php" >> /tmp/yourlog.txt
END;
how can I get data for the row updated.
Regards,
NewDev
...
Hi guys, I am having some consistency problems with my flash application, when I echo out variables for flash to get, it doesn't always pick up what PHP is sending, it seems to vary from PC to PC.
I am getting info from a database, and I need to pass it to flash, say for instance I need to send through 5 variables $uid,$name,$points,$f...