mysql

How to use avg function?

I'm new at php and mysql stuff and i'm trying to use an avg function but i don't know how to. I'm trying to do something like this: mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die ("Did not connect to $database"); mysql_query("AVG(column1) FROM table1 ") or die(mysql_error()); mysql_close(); echo AV...

Python: mysqldb install error

So i've been pulling my hair out trying to install the mysqldb package. When i run the build i get a long transcript of errors, heres just part of it, i would posit it all but its huge list of errors [rv@med240-183 MySQL-python-1.2.3c1]$ sudo python setup.py build [sudo] password for rv: running build running build_py copying MySQLdb/re...

Account activation PHP

I created this account registration activation script of my own, I have checked it over again and again to find errors, I don't see a particular error... The domain would be like this: http://domain.com/include/register.php?key=true&p=AfRWDCOWF0BO6KSb6UmNMf7d333gaBOB Which comes from an email, when a user clicks it, they get r...

Can one connection get details of another? Or, how can I get the most detailed pending transaction report possible?

Is there a Mysql statement which provides full details of any other open connection or user? Or, an equally detailed status report on myisam tables specifically. Looking at Mysql's SHOW TABLE STATUS documentation, it's missing some very important information for my purpose. What I'm trying to do: remote odbc connection one is insertin...

mysqli returns only one row instead of multiple rows

Hello, i'm totally new to mysqli and i took a generated code and adapted it for my need. UPDATED : public function getServeurByName($string) { $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename where GSP_nom=?"); $this->throwExceptionOnError(); mysqli_stmt_bind_param($stmt, 's', $strin...

Does column ordering in databases affect performance?

I am using Django with MySql. I have a CharField with max length of 64 as the 2nd to last column, and a Boolean as the last column. Will reversing the order of these provide better optimization of space? ...

Validating Login / Changing User settings / Php Mysql

Hi everyone, my questions are about login, and changing already saved data. (Q1) 'Till now I've only saved input in the tables of the database (registration steps), now I need to check if the input (login steps), are the same of my table in database, in fact I have 3 types of users, then I'll have to check 3 kind of tables. Then if the ...

How do I store recent searches in database??

How do I store recent queries in a database?? I know how to find recent searches which is inserted/modified the database but if it isn't inserted/modified then how do I find recent queries??? ...

ORDER BY letters and not numbers of a field

Is there a way to order mysql results by the first letter and ignore numbers? For example, I have a list of addresses: 123 Main Street 456 Second Street 234 Third Street and I want to order by the street name and ignore the street number. Is there an easy way to do this? ...

Renaming column in Android sqlite database results in error

I've been modifying the Notepad tutorial for Android very subtly- all I did was rename the column from title to name: Before: public static final String KEY_TITLE = "title"; ... private static final String DATABASE_CREATE = "create table notes (_id integer primary key autoincrement, " + "title text not null, body tex...

MySQL Grant Problem

Why might the following grant statement fail to work? grant all on kylie.* to 'kylie'@'localhost' identified by 'foo'; Here's the complete output. $ mysql -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 63 Server version: 5.1.37 Source distribution Type 'help;' or '\h' for help. Type '\c' to ...

Echo autoincrement id doubt

Hi, can I print the id, even if it's autoincrement ? Because the way I'm doing I'm using an empty variable for id. $id= ""; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die ("Não conectou com a base $database"); mysql_query("INSERT INTO table1(id,...) VALUES ('".$id."',....)") or die(mysql_error()); m...

Want to retrieve data from database using Flex+Cairngorm framework..

Hi.. I am new to cairngorm framework.. I need to retrieve the table data to flex UI using Flex + Cairngorm and PHP + MYSQL.. I got it using Flex alone using xml + PHP + MYSQL.. But in this case, i can't get the table data values.. Need a sample application with source code.. Help me.. Please.. Thanks in advance.. ...

how to fetch data from multiple tables MySQL

hi all, I am looking some help in php+MySQL+jquery I have 2 tables table1 table 1 have 4 colume (id, title, desc, thumb_img) tabel2 table 2 have 3 colume(id, table1id, img) I just want to compare 2 table with the value of $_get['QS']; and show the records from both (title, desc, img) Looking forward for the help.:) ...

mysql select column from view problem

i create a view table like : CREATE VIEW ViewManager AS SELECT us.UserId AS 'Account Manager', ......... after that, when i run a query to select data from this view like : SELECT 'Account Manager' , .. from ViewManager then the data i get in this column is the text 'Account Manager' and not the value of the this columns. Is th...

last queries mysql v$sql

i have oracle background, i am looking for oracle v$sql view in mysql in order to see last queries has been run on all sessions in database how can i see this in mysql ? ...

Efficient way to store order in mySQL for list of items

I want to code cleaner and more efficiently and I wanted to know any other suggestions for the following problem: I have a mySQL database that holds data about a set of photograph names. Oh, say 100 photograph names Table 1: (photos) has the following fields: photo_id, photo_name Ex data: 1 | sunshine.jpg 2 | cloudy.jpg 3 | rainy.jpg...

mysql search number in table

hi, i am using php/mysql. i have a product table . in which most product have starting name with number. i want to listout all products start with any number. any one have idea about it.... ...

data in mysql show after barcode split and matches character

i need some code for the next step..this my first step: <script> $("#mod").change(function() { var barcode; barCode=$("#mod").val(); var data=barCode.split(" "); $("#mod").val(data[0]); $("#seri").val(data[1]); var str=data[0]; var matches=str.matches(/EE|[EJU]).*(D)/i); ...

MySql: How can I use temp table when creating view?

MySQL doesn't allow temp table when creating a view, is there any work around for that? ...