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...
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 ...
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...
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?
...
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;
...
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|
-------------...
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 ?
...
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...
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...
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
---...
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 ...
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?
...
I want to populate my dropdowns with enum possible values from a DB automatically. Is this possible 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%
...
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...
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 ...
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 ...
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 ...
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...
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.
...