mysql

jQuery, PHP: Calling a PHP script from jQuery, but it doesn't appear to be executing

Hi y'all! I'm using the source code found on this site here: http://webtint.net/tutorials/5-star-rating-system-in-php-mysql-and-jquery/comment-page-1/#comment-2562 A fantastic resource, I think you'll all agree, but my problem is that my Javascript doesn't appear to be actually executing the PHP script... When I add a breakpoint in Ch...

mysql query normal relationship table vs concatenated realtionship table

I have a question about relationships between two tables. Let's say we have a table users, and links. users +++++++++ id name 1 name1 2 name2 3 name3 +++++++++ links +++++++++ id link 1 link1 2 link1 3 link1 +++++++++ Now the normal way to link these two is with a name_links table. For example: name_links ++++++++++++ uid ...

Creating subquery using IN

I have a question on making a good subquery for this problem Let's say we have a table users, and links. users +++++++++ id name 1 name1 2 name2 3 name3 +++++++++ links +++++++++ id link 1 link1 2 link1 3 link1 +++++++++ And lets say i have a relationship table like this name_links ++++++++++++ uid lid 1 1,3 2 1,2,3...

Can user defined variable be used with ADODB connections from PHP5 to a MySQL4.x server?

I'm trying to execute a SQL statement using the ADODB PHP library against mySQL4.1 : $rs = $db->execute("set @name = ?; select @name", array('test')); but it does not seem to like this. Is it possible to use variables with prepared statements? ...

Performance issues when checking if record exists in mySQL?

I am wondering if there is a performance difference between these two queries that check if a record exists? select count(1) from table where id = 1; or select id from table where id = 1; ...

Product count of a subtree SQL nested set

See http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Under the heading "Aggregate Functions in a Nested Set" I'm trying to work out a query similar to the example given, except I want it to work at a sub-tree level, so if I queried for MP3 players I would get a result set like; |NAME |COUNT| -------------...

Retrieve records in a range using year and month fields in mysql

I have a mysql table with year (YEAR(4)) and month (TINYINT) columns. What is the best way to select all records in a range, e.g. 2009-10 .. 2010-02 ? ...

MySQL PHP zip code comparison specifically distance

Hi everyone! I'm trying to figure out what would be the most efficient (with respect to load time) to compare the distance between one zip code (which the user provides) and a whole bunch of other zip codes (there's approximately 200 zip codes right now, but its subject to increase over time). I don't need anything exact just in the bal...

Two single-column indexes vs one two-column index in MySQL?

I'm faced with the following and I'm not sure what's best practice. Consider the following table (which will get large): id PK | giver_id FK | recipient_id FK | date I'm using InnoDB and from what I understand, it creates indices automatically for the two foreign key columns. However, I'll also be doing lots of queries where I need to...

Need help with mysql query

hi all, I'm new to mysql so please can you help me. I have 2 tables "words" and "text" words has columns: word synonyms text has columns: text word article_id I need to get unique words.word, and biggest unique text.atricle_id fields. The same article_id can have different words. for example words word synonyms ---...

How to get ID value with jquery and send to PHP script?

Hello, I am trying to get an id value of a link with jquery then send that id to a php script (in this case sending it to a php sql query). I have a link like this on the main page: <a href="#" id="category1">Category One</a> when this link is clicked, I would like jquery to grab the id value ('category1') and place it in a seperate ...

How to add a where clause in a MySQL Insert statement?

This doesn't work: INSERT INTO users (username, password) VALUES ("Jack","123") WHERE id='1'; Any ideas how to narrow insertion to a particular row by id? ...

How can I get enum possible values in a MySQL database?

I want to populate my dropdowns with enum possible values from a DB automatically. Is this possible in MySQL? ...

Identifying who makes a lot of INSERT requests in MySQL

Hello. Recently, I noticed that my MySQL server processes a lot of INSERT's. How can I detect user or DB on which is this activivty?? insert 33 k 97.96 k 44.21% ...

cannot retrieve value in database and cannot update the table

situation: i have changepass page to change password. but the page cannot retrieve and display the value in the database. i want to display the ID, name and department that have been stored in the db. the newpasswword also cannot be update...plz..help me.. here's the code: <?php session_start(); $username = $_SESSION["username...

Retrieving truncated record from mysql database

Say you have a string 3.4564. A sample set in the database has these records(VARCHAR): Name Score Peter 3.35643294332 John 3.47870923 James 3.740249842 Henry 4.0432849 Solomon 3.456183923 Andrew 3.45743 You want to truncate 3.4564 to 3 decimal places(to become 3.456) then compare with the values of ...

How to run a java program on a server?

I have made a java application that stores data from a .csv file to a MySql database. Now my client want it to upload this application to his web space (web space he has taken for his website) so that he can run that program on that server. I have used FileZilla software to upload the program to his web hosting but now I don't know how ...

Problems calling MySQL stored procedures from C API

Hello, I have a problem calling a stored procedure on my MySQL server using the C API. I use mysql_query(&handle,"CALL myprocedure") but the function fails (returns 1) and error lookup gives the following message "Procedure myprocedure can't return a result set in the given context." I even tried to use mysql_real_query insted, but no ...

mysql problem: populate table from another table but referencing ID instead of name

Hi, I'm now trying to populate my 'testMatch' table (below) with data from my 'summary' table: TESTMATCH TABLE +------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------+-------+ | match_id | int...

html form class

Is there any html form class(text box) that does not allow null values. The inputted data is to be stored in a mysql database. ...