Hi there. I'm new on mysql, but I have a database with some data, ordered by name:
<option value="4"> George </option>
<option value="55"> John </option>
<option value="13"> Paul </option>
<option value="24"> Ringo </option>
I want to put this on a select, like this:
while($row = mysql_fetch_array($result) ){
echo "<optio...
My problem is fairly simple. I have table sets that store product sets (more products looking like one on the outside - computer, mouse and keyboard for ex.) it's connected M:N using sets_products table to products table. Each product can have parameters (connected again M:N).
I have a procedure, that generates all parameters as string...
Is there an open-source alternative to MaxMind GeoIP Country/City that I can use for MySQL?
...
Hello guys,
Given the following table, how can write a MySQL query to display threaded comments in a single page?
Table structure:
comment_id
comment_parent
comment_content
Thank you.
...
Is there any way to run UPDATE or INSERT inside a SELECT statement in mysql?
...
Ckeck out http://www.blocket.se/goteborg?ca=15
Look at the first ad.
Copy the headline, and paste it into google, and also write 'blocket' after the headline in google, now search.
You will see it finds the ad right away.
How come?
Does googles crawlers really update their index that fast?
Or is it just because you entered that sea...
I have the following parent <-> child datamodel:
(almost every line is a table, indented means child-of)
consumerGoods
food
meat
item
fruit
item
vegetable
item
The child-items of meat, fruit and vegetables are in the same table (named items) because they have identical a...
Hi,
I am currently learning MySQL and am noticing a lot of different do's and don'ts.
Is there anywhere I can find the absolute list of best practices that you go by or learned from?
Thanks for your time.
...
Hi, I have a forum the user fills out with 2 separate radio button categories they can fill out.
Permissions: private <input type="radio" name="permissions" value="private" /> public <input type="radio" name="permissions" value="public"/><br />
Category: default <input type="radio" name="cat" value"default" /> sport <input type="radio...
Hi guys!
I have a MySQL database with the following columns:
id company rating_score rating_place
I have companies and rating scores for each company. So, my db looks like:
id company rating_score rating_place
75 Intel 356.23
34 Sun 287.49
etc.
How can I assign the p...
I would like to create an interface for manipulating invoices in a transaction-like manner.
The database consists of an invoices table, which holds billing information, and an invoice_lines table, which holds line items for the invoices. The website is a set of scripts which allow the addition, modification, and removal of invoices and...
Given the table snippet:
id | name | age
I am trying to form a query that will return 10 people within a certain age range. However, if there are not enough people in that range, I want to extend the range until I can find 10 people.
For instance, if I only find 5 people in a range of 30-40, I would find 5 others in a 25-45 range.
I...
Hello!
I would like to measure how much time a user spends on my website. It's needed for a community site where you can say: "User X has been spending 1397 minutes here."
After reading some documents about this, I know that there is no perfect way to achieve this. You can't measure the exact time. But I'm looking for an approach which...
My title is terrible but I'm having a hard time wrapping my head around this. I have two tables. Links and Votes. Links contain info about links submitted and the usual jazz, votes contains a foreign key link_id and a karma_up and karma_down value (both unsigned ints). Because I want to limit votes to one per user and record vote tim...
I have an old joomla site (v 1.0.11) that I would really like to move over to Blogger or Wordpress. The commenting on the site uses AkoComment which was an add on module. Basically, I want to transfer:
posts
comments
users
css
I haven't found a good tool out there to do this. What tools would be best to begin to work with this dat...
Here is my mysql query below. Through many helpful questions and comments I am almost at the end of my journey. The idea behind this query is a user submits a link, the application inserts two rows, one into links and another into votes (a default vote, why wouldn't a user vote for their own submission?) Then every vote is just anothe...
It stumbled upon me while I was reading the query in another post.
Take the following query for example (ignore the non-practical use of the ordering):
SELECT
*
FROM Members
ORDER BY (TIMESTAMPDIFF(FRAC_SECOND, DateCreated , SYSDATE()))
Say "Members" table has a huge row count (or the query is complex enough for it to be executed o...
I do a lot of coding in PHP and MySQL, but I'm looking at moving my applications to a desktop environment in order to allow users to access the data offline, and periodically receive updates from a central online database.
For the time being, however, I'm looking for a decent tutorial on how to convert PHP applications to Cocoa, and how...
I have to insert and then keep updating 1000's of records every minute, will mysql transaction help in the speed performance as it does in sqlite3.
I carried out a test (Inserting 1300 records) but showed the same result with InnoDB (for transaction) and MyISAM.
Using MySQLdb for Python
...
Below is the code:
$result=mysql_query("select * from choices where a_id='$taskid'")or die(mysql_error());
print_r($result);
I get "Resource id #4", any idea?
After I added
while($row=mysql_fetch_assoc($result))
{ print_r($row); }
I just got []
What's wrong?
...