MySQL trigger problem
Hello, I have 2 tables: User (id, user, pass, ...) Post (user_id, post, ...) I would like to create a trigger wich delete post of a user, before deleting user... Can you help me? ...
Hello, I have 2 tables: User (id, user, pass, ...) Post (user_id, post, ...) I would like to create a trigger wich delete post of a user, before deleting user... Can you help me? ...
I try to a web servis with Qt. It controls database server connection. it is connected or not. In one second open database and close database is logical or with a dummy query in one second query database is logical ...
I have these tables: USER TABLE uid | name | role | | 1 | bob | package 1 2 | jill | package 2 3 | pam | package 1 NODE TABLE nid | uid | type | | 1 | 1 | car 2 | 1 | car 3 | 1 | car 4 | 2 | page 5 | 1 | car 6 | 3 | car If I do: select u.uid, u.name, count(nid) as totalNodes from USER...
Is there a way I can tell my MySQL query to start from a specific id and end at another using MySQL? ...
Hi everyone i'm getting this syntax problem and i don't see anything wrong with my query. I'm kind of new at SQL as i'm still an undergrad. I'd really appreciate it if you could help me with this. This is the code. : $results = mysql_query("SELECT event.nameevent,event.eventid FROM event,sub WHERE sub.userid=$userid AND event.e...
I storing articles in database that contains special characters like ", ', etc. but it gives error while saving in MySQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's and Moral Science's books in school. I clearly remember the picture of a Hin...
I have this script that loops to make a category tree. But I want it to display specific categories that a user picks like in the example below. On a side note the script loops in-order to build the url link to the category. I guess what I'm trying to say is that I just want to know how to display specific categories and their full url...
Hi, I have my data stored in a MySQL table, which includes an auto_increment ID number (unique) for each new row. I'd like users to be able to get a certain ID number, using the $_GET function. eg. User loads http://mysite.com/id.php?id=123 Page displays ID number 123 along with the row. echo $row['id']; echo "<table>"; echo "<tr> <t...
We're deploy an Instant messenger (AJAX), for it we write a comet server who will handle the communication now we want to store the sent messages to a DB, which DB engine one give the best performance? We talk about 5000 Insert/sec, i think MySQL and PostgreSQL was out of the game, any proposals? HamsterDB, SQLite, MongoDB ...? We don'...
my code- require 'database.php'; $title = mysql_real_escape_string($_POST['title']); //line 48 $cat = $_POST['cat']; $txtart = mysql_real_escape_string($_POST['artbody']); //line 50 $date = date("d-m-y"); $q = "INSERT INTO tblarticle (art_title, art_cat, art_des, art_date) VALUES ('$title', '$cat', '$txtart', '$date')"; ERROR--> Wa...
Hi all, For a client I have built a travelagency website. Now they asked me to optimize and automize some things. One of these things is that the accommodations shown in the searchlist must be bookable. Simplified this is the structure I have an AccommodationObject, an Accommodation has 1 or more PricePeriods. What I need to do pick ...
I'm using various boolean flags in my tables, and from reading a bit about optimizing performance I came across a widespread tip to avoid using boolean flags. What are the effective alternatives? Some examples would be much appreciated. ...
I am trying to create a user login/creation script in PHP and would like to know the best way to check if a username exists when creating a user. At the moment, I have the following code: function createUser($uname,$pword) { $server->connect(DB_HOST,DB_USER,DB_PASS,DB_NAME); $this->users = $server->query("SELECT * FROM u...
I have run in to a slight problem. The story goes as follows: I have a document archive system (written in PHP) which runs at multiple clients (23 at present). On their system they only have their documents. Every night, they all need to be 'synced' to a master database on site (central server). I have access to each MySQL database from...
Hey Friends i am having some list of domains in the DB,like http://www.masn.com/index.html http://www.123musiq.com/index.html etc what i need as out put is http://www.masn.com http://www.123musiq.com how can i do that in regular expression??? ...
MySQL is putting off the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE IF NOT EXISTS `badips` ( `id` int(10) NOT NULL auto_increment, ' at line 2 When I run the following PHP: if (file_exists("../login/includes/confi...
We have two data centers located across the globe. if we run the rails app in one datacenter and point to the database located in the other data center. The app throws MySQL server has gone away like once in every 5-6 web request. and show 5000 internal server error but if we put both the app and the mysql db in the same datacenter....
Hi, I have a list of zipcoded in a MySQL Database together with their Latitude & Longitude data (Column names: ZipCode, Lat, Lon). Now I have to make a search requests (search for the zipcode) to extract information from a website. When I make this search requests the results include all information within a radius of 50km of the zipco...
Hi all. I'm trying to get 2 counts from 2 tables and work out the percentage like for a mysql db 1) select field_one, count(*) as COUNT_ONE from table1 group by field_one; 2) select other_field,count(*) as COUNT_TWO from table2 group by other_field; I want to combine the results and have FINAL_COUNT=(COUNT_ONE/COUNT_TWO) * 100 for pe...
I have one website which does not use US timings. Is it possible to change PHP and MySQL timings for one website? If so what do I need to do? ...