I get this error, while I'm testing the code below:
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 '[student](ID, LASTNAME, FIRSTNAME, SCHOOL) VALUES ('333', 'aaa', 'aaa', 'aaa')' at line 1
I just recycled the code that I used in manipulating ms sql...
I'm trying to add a datagridview in vb.net, but it does not allow me to change the connection string or the database that should be imported to connect to it. The only thing that I'm seeing is the previous ms sql database that I connected with datagridview and everytime I click the new connection, the window closes and it leaves me with ...
Hi,
I found this great Tablesorter plugin for jQuery but I can't make it work with my PHP generated table. Here's the code:
<script type="text/javascript">
function table() {
$("#container").load("table.php?randval="+Math.random());
}
$(document).ready(function() {
table();
$("table").tableso...
Where can I download sample Mysql database?
I would like to test some queries, but not have any data in the database.
Where can I find it?
...
I'm working on my dedicated server running CentOS. I found out that one of my applications which starts up via a script in /etc/init.d/ requires MySQL to be running, or else it throws an error, so essentially I currently have to start it by hand.
How can I detect, in a bash script (#!/bin/sh), whether the MySQL service has started yet? ...
I've got a MySQL database that stores image information. Right now it only has three rows stored in the database, and each row is associated with something like, for instance, a unique blog post via a key column.
As of right now, one "blog post key" has one image, and one has two images in the database.
When I run this query, MySQL ret...
Any suggestions for a real simple C library to query a single MySQL table, nothing fancy here. Just doing a single select * from a table. Any help is appreciated.
...
I have the following MySQL query:
SELECT *
FROM customer
WHERE
fName LIKE '%#attributes.q#%' AND deleted = 'N'
OR
lName LIKE '%#attributes.q#%' AND deleted = 'N'
This works fine for guesses, but if you provide an exact match: "Bill Clinton" fname=bill lname = clinton to the query above you get 0 results? where bill clint gives...
I have a blog, which is on Drupal v6.14. Recently I changed my web hosting provider. My new hosting provider does'nt support MySQLi. So I have to use MySQL instead of MySQLi. All things worked fine for some days. But on a very fine morning, I found my blog is down and the error message was Mysql: Too Many Connections to the server. And t...
I would like to access a MySQL database using PHP.
Can someone please explain the basic steps involved in doing that?
...
A column with a foreign key to another table's column. How do I do that?
...
I'm running an MySQL query that returns results based on location. However I have noticed recently that its really slowing down my PHP app. I used CodeIgniter and the profiler shows the query taking 4.2seconds. The geoname table has 500,000 rows. I have some indexes on the key columns, how else can speed up this query?
Here is my SQL:
...
Suppose I have my models set up already.
class books(models.Model):
title = models.CharField...
ISBN = models.Integer...
What if I want to add this column to my table?
user = models.ForeignKey(User, unique=True)
How would I write the raw SQL in my database so that this column works?
...
Hi all,
I am currently working on a small sponsorship application(PHP/MySql) for my personal blog, and am almost finish, but I am stuck on how to calculate the click-thru rate of my sponsors campaigns.
I was always terrible with working out percentages, so any practical help would be appreciated. The data is stored in the DB as simple ...
I have a simple MySQL table thats contains a list of categories, level is determined by parent_id:
id name parent_id
---------------------------
1 Home 0
2 About 1
3 Contact 1
4 Legal 2
5 Privacy 4
6 Products 1
7 Support 1
I'm attempting to make a breadcrumb trail. So i have the 'id'...
I have a table of events called event. For the purpose of this question it only has one field called date.
The following query returns me a number of events that are happening on each date for the next 14 days:
SELECT
DATE_FORMAT( ev.date, '%Y-%m-%d' ) as short_date,
count(*) as date_count
FROM event ev
WHERE ev.date >= NOW()
GR...
I just installed Apache 2.2.15/PHP 5.3.2/MySQL 5.1.44 on Windows Vista. Apache is working fine, PHP is functional, and MySQL works on the CLI. However, when I try to access MySQL via PHP, I get an error (Fatal error: Call to undefined function mysql_connect()). extension=php_mysql.dll and extension=php_mbstring.dll are uncommented in the...
Hi guys, I'm modifying our collaboration system so it can be listed on google applications. A small issue I'm facing is the registering of user details. By default whenever someone logs into their google Apps account they pretty much are logged into the application.
For every action taken by a registered login in user I store the user ...
One day, wordpress suddenly jumped from pots id 9110 to 890000000 post.
Days later I'd like to move back new posts to continue from id 9111.
I'm sure that id will never reach id 890000000, no problem here, but id is an autoincrement field and ALTER TABLE wp8_posts AUTO_INCREMENT = 9111 is not working.
Can I force id to continue from 911...
I want to initialise a 'ticket' table with some ticket IDs. To do this, I want to insert 120 ticket IDs into the table. However, at every 10th statement, MySQL tells me that the ID already exists and thus won't let me insert it. Here's my code:
//make a query
$insert_ticket_query = "INSERT INTO ticket (id) VALUES (?)";
$inse...