mysql

How can I retrieve the number of rows deleted with PDO?

Hello everyone, Okay, so I have been using a PDO wrapper for a project I'm working on, and I'm trying to find out whether a DELETE query was successful or not. Here is the code I am using: /** * A pretty straight-forward query to delete a row from the verification * table where user_id is $user_id and code is $code */ $result = $this->...

adding a delete icon to jQuery UI sortable portlets running with php, mysql

I have a working sortable portlet running with php and mysql. My problem is i cant get the delete function working with just the icon inside the portlet-header.instead the deleting covers to complete portlet class (what makes sence) however i need it only for the ui-icon-closethick $(function() { $(".portlet").click(function() { va...

Help with SELECT statement

First, I know that's a terribly vague title -- my knowledge of SQL is so weak that I don't really know the particulars of what I'm asking, so please bear with me. I have a table that looks like this: +--------+-----------+----------+--------+--------+ | gameid | team1 | team2 | score1 | score2 | +--------+-----------+----------+...

How do I get the $num_rows variable to work

Everything in my code works but $num_results... Book-O-Rama Search Results Book-O-Rama Search Results //create short variable names $searchtype=$_POST['searchtype']; $searchterm=$_POST['searchterm']; $searchterm=trim($searchterm); if (!$searchtype || !$searchterm) { echo 'You have not enter...

Can I use the Zend framework without command line access?

Lets say yy only option right now is to work on files from my jump drive that I keep on my keychain. I've got a few computers I can use to code on, but none that I can install anything on or alter in any way. Could I get started and use the 'powerfulness' and functionality of the zend framework by just downloading the files to my jump dr...

MYSQL COUNT GROUP BY question

I'd like to only select the rows where the count is greater than 1 (in other words the duplicates) right now from a few thousand records i am mostly seeing ones with a few 2s and 3s here and there SELECT count( * ) AS `Number` , GI . * FROM `GeneralInformation` AS GI GROUP BY `FirstName` , `Surname` how can I do this? ...

Mailing List Data Schema

Hi, My website allows for anonymous sign-up of a mailing list. The same mailing list is also sent out to registered users. The problem is when the anonymous user transitions to a registered user --- I don't want to spam the same email address twice. My user table is as follow: CREATE table users ( user_id integer not null primary k...

How do forums show you unread topics?

I have user discussion forums I coded in php/mysql, I am wanting to know how the big name forums can make it show you which topics have new posts in them, usually by changing an icon image next to the thread without using hardly any resources? ...

loading edit form only if GET var exists in database

What my script currently does: grabs & cleans a $_GET['id'] pulls all pre-existing data from TABLE for that id displays form populated with any pre-existing data SUBMIT sends form data to update script, adds all data to TABLE What I want my script to do: grabs & cleans a $_GET['id'] pulls all possible (id)'s from TABLE (this I know...

MySQL VARCHAR Lengths and UTF-8

In MySQL, if I create a new VARCHAR(32) field in a UTF-8 table does it means I can store 32 bytes of data in that field or 32 chars (multi-byte)? ...

Database design of a tree-like category system

Hi guys, I'm using the Adjacency List Model to create categories, and it works perfectly. When retrieving articles in a certain category (for example electronics), I would like to also retrieve the articles in the sub categories (for example electronics->cameras, or even electronics->cameras->camera lenses). The way I am doing it now ...

mysql_free_result() or mysql_close()

on my site database gets disconnected after few minutes and gets connected after few minutes automaticaly.....i think it is due to exceeding the mysql connections...what should i use mysql_free_result() or mysql_close().....or let me know if there is any other problem.... ...

What is wrong with this mysql query?

Hai guys, I ve tried a query and i dont know what is wrong with the select statement,when i execute this no records are returned... It seems rollid=3 is the prob records with rollid 3 are not fetched, select * from tbl_emp_personal_master where dEmp_id ='7' dEmp_id is int I even tried removing quotes from '7' to 7 it didnt help ...

Opensource packaging software for Mysql Server with Java Desktop Application

I have a Java desktop application which uses mysql database . Is there any Open source software for packaging or executable wrapper of Mysql server and Java desktop application into one single Exe/Debian package where i need not separately install Mysql server separately . Its like one click installer which installs everything and the...

What column type should I use to store values between 0 and 1 (say up to 5 decimal places) in MySQL?

It is most important that it be accurate, but also it should take the least disk space possible. ...

Which one of these queries has a better performance?

I have three tables, with these fields: classes: class_id | name | grade classes_students: class_id | student_id students: student_id | name Classes has a n:m relationship with Students, so one class can have many students, and one student can listen to many classes. I want to select all students of a particular class, where class_...

How many tasks can task scheduler run simultaneously

How many tasks can task scheduler run at the same time? I have set up three backup tasks from within SQLyog, all to start running at 12:00 am and run at subsequent 4 hours until midnight. Each task will backup all tables from three different databases to a network attached storage. Will there be any impact on the MySQL Server performanc...

what to do when ' repair table ' query won't work in mysql ?

hello all, i got this error : "The storage engine for the table doesn't support repair" when i tried to repair the table using the query repair table tbl_college_master table is of innodb type, but i dont know y i'm getting this error? ...

help with php search

How would I do let the user know if there wasnt any rows found? And if it finds (for example) 26 rows I want it to print that it found 26 hits (Your search for "hey" gave 26 results) $name = mysql_real_escape_string($_POST['player_name']); $q = mysql_query("SELECT * FROM players WHERE name LIKE '%$name%'"); while ($row = mysql_fetch_a...

How do I construct a cross database query in PHP?

In our last episode (How I constructed a cross database query in MySQL) I learned how to construct a cross database query in MySQL. This worked great but when our hero tried to use this newfound knowledge in PHP he found his best friend FAIL waiting for him. I took a look at mysql_select_db for PHP. This seems to imply that if I want to...