Hi all,
I am trying to trying to retrieve some values from a user using a QLineEdit widget. When a QPushButton raises a clicked event, I want the text to be retrieved from all QLineEdit widgets and stored in a local MySQL databaase. However, when I try to use string substition in the insert statement, the values don't get substituted. H...
I have been looking at a N-level tree class.
Could anyone possibly advise on the best way I could display the results ie, the looping of the result set, should I use DIVs or ULs?
An example result set will look like so if you find the article too long to read
Array ( [531] => stdClass Object ( [id] => 531 [rid] => 0 [created] => 12553...
Trying to pull rows from a table and list them in an ol, however, my code only wants to return the last 2 out of the 3 total rows.
<?php
// Connects to your Database
mysql_connect("mysql.***.com", "***", "***") or die(mysql_error());
mysql_select_db("shpdb") or die(mysql_error());
$data = mysql_query("SELECT * FROM savannah") or die(mys...
Trying to perform a very simple task here.
I have an <ol> that contains 4 rows of data in some handy <li>s. I want to add a delete button to remove the row from the table. The script in delete.php appears to have finished, but the row is never removed when I go back and check dashboard.php and PHPMyAdmin for the listing.
Here's the cod...
Hi, the MySQL manual says that a CASE statement (the WHEN part) can contain a statement_list.
How much statement is that to be exact? I need to perform a pretty big query which I would like to parametrize. However this also implies that I need to change tables that are being joined. I've read that this cannot be done using CASE statemen...
while($info = mysql_fetch_array( $data )) {
// Print out the contents of the entry
Print "<li><b>Name:</b> ".$info['name'] . " <br />";
Print "<b>ID:</b> ".$info['ID']." <br />";
Print "<b>Age:</b> ".$info['age'] ." <br />";
Print "<b>Location:</b> ".$info['location'] ."<br /> ";
Print "<form action=delete.php method=POST><input name=ID ...
I've got a mental block. I'm pretty certain this is a dead simple noob question to solve, but I'm drawing a blank:
I have a tagging system for articles. This is done by having a separate table that contains an article ID as well as a tag ID, so multiple tags can get assigned to one article and vice-versa. It all works well. But now what...
I need to merge two query results as in union, but I want to only keep the difference between the two results... Is this possible?
I'm basically selecting ALL resources in Query 1, and NOT-ALLOWED resources in Query 2, I obviously need the ALLOWED resources in my last result...
In pseodo-code:
Query1 - Query2
Queryresult 1:
+-----...
Hi,
I am going to create an app for managing grid-like model - cells at [X,Y] coordinates.
This model will be persisted in a RDBMS.
I want to keep much of the processing right in the DB server.
So I am looking for an PL/SQL library for 2D grid processing (each row represents one cell).
It should know to do algorithmic things like s...
SELECT * FROM a
JOIN (SELECT * FROM b WHERE b.aId = a.Id) AS c ON c.aId = a.Id
It says does not recognize: a.Id in the Where Clause.
I know its probably cause im using a temp table and a.Id cannot be passed through but is there any way we can do that?
Because here is what actually happens
SELECT *
FROM a
JOIN (SELECT * FROM...
update accounts set type=1 where id=2;
update accounts set type=3 where id=4;
...
hi, i have a mysql table set up like so:
id uid keywords
-- --- ---
1 20 corporate
2 20 corporate,business,strategy
3 20 corporate,bowser
4 20 flowers
5 20 battleship,corporate,dungeon
what i WANT my output to look like is:
20 corporate,business,strategy,bowser,flowers,battleship,dungeon
b...
I have some SQL output that id like to format into a collapsible div. The problem is that all the JS show/hide div code i find isnt really meant for dynamic instances, they all need to be pre assigned to a particular div. Since my results may vary from 1-30...this isnt really a good option.
My question. Is there an easy way to dynamical...
for some reason, I want the logic resident in MySQL, not in PHP.
...
Hello stackoverflowers,
I have a straightforward question.
I am doing a web application that uses MySQL, and I am currently designing it. I just have a small question about performance.
I would like to know what is more efficient:
Scenario #1:
Table: Restaurant
-Name
-City
-Province
-Country
-Continent
sql =...
Im trying use the following insert:
mysql_query ("INSERT INTO users (company_name, fname, lname, salt, email, date_added, password)
VALUES ('$CompanyName', '$fname', '$lname', '$salt', '$email', '$mysqldate', '$encrypted')")
or die(mysql_error());
But I get an error:
Unknown column 'company_name' in 'field list'
...
I would like to have access to Seconds_Behind_Master (as returned by SHOW SLAVE STATUS) from inside a stored procedure, but can't figure out how to get its value inside a variable. None of the usual SET/SELECT syntax seems to work. Is there a way to do that?
...
I have a problem here. I have about 13K rows of data that I want to put into a mysql database. What I notice is that if the row is "short" the insert will happen but if it is long, it fails. I have been trying to figure this out all day and I'm about to give up.
Here is the table structure.
CREATE TABLE `concordance` (
`term` text NO...
I have 2 large mysql tables: Articles and ArticleTopics. I want to query the DB and retrieve the last 30 articles published for a given topicID. My current query is rather slow. Any ideas on how to improve it?
More details:
The tables:
Articles (~1 million rows)
+-----------+--------------+------+-----+---------+----------------+
| Fi...
How to move data from suppose mysql database to postgres database?
Scenario: Two similar application. A user wants to switch from one application to other.
But he had maintained certain data information in his previous appilaction which uses mysql database.When he switch his appliaction he has to move his data from his old application t...