mysql

PHP & MySQL vote count problem?

I found this script on about.com which I'm trying to learn from on how to create a rating system but the script for some reason wont count a vote when the link is clicked and just reloads the page. I was wondering how can I fix this problem? And what part of the code do I need to change and where? Here is the full script below. <?php ...

help me in this query

i am trying to develop a site where users can become friends of each other and can see their posts after the date the became friends........i have already posted this question about 5-7 days but could not find any solution........!! so... i have two tables.......... posts and friends and my query is $sql = mysql_query(" SELECT * FROM p...

Properly Filter with PHP/MySQL and Select Box

Hello all, I currently have a large table in MySQL with several fields. I am currently attempting to allow the user to filter by each field, via Select Boxes. I have 4 fields: School, Division and State. I have no problem, using PHP, on how to filter based on which option the user selects in the select box. For example, if these 3 a...

How do I create a table alias in MySQL

I am migrating an MS Access application (which has linked tables to a MSSQL Server) to MySQL. As a means to overcome some MSAccess table naming problems, I am seeking a solution to add a MySQL table alias that will point to an existing table in the MySQL database. Ideally I would like to create the alias 'dbo_customers' in mysql that ...

php passing Id to next page and from database

I am inserting some info into a database table with php and mysql. I am trying to diplay the same information inserted into the table in the next page. I know that if I send the ID it won't work becuase the row hasn't been created yet, it will display an empty page. Is there a way around this? I need the information to come from the tab...

How to force mysql.exe to run in "interactive" mode?

I'd like to get emacs sql-mysql mode working in windows xp. I'm able to enter sql-mysql mode and connect to mysql database successfully. The problem is that the SQL buffer doesn't show the "mysql>" prompt. In other words, it's not interacting with mysql.exe. I think it's because the mysql.exe program is going into "non-interactive" mode...

zend_db adapter not in / zend_db_expr

I have a call to a model which is just a standard class (not extending zend_db_table). I am doing a select and want to have the possibility of excluding a set of ids which which would be passed in as a variable. I curently have the following: public function getItemsBySection($section, $excluded_ids=null){ //handle this as special...

taskkill Mysql from .ASPX -- Permission Problems?

Our mysql instance occaisionally locks up during backups. Currently we must VPN into the corporate network (to obtain work I.P.), remote desktop into the server, open the task manager, and manually kill the mysqld-nt.exe process. Instead of doing all of this we are attempting to create a simple webpage that we can log into to kill and r...

Hibernate : Java Application must be restarted for data to be realoaded.

I am programming a JSP/JSF Web application and currently using Hibernate (and MySQL) libraries. When I update data using my running application everything is working fine. Example : I modify a customer information Although if I change data manually or add an entry in MySQL manually, the change will not be effective on my application si...

MySql and inline SELECTs

I have a query that looks like this: select id , int1 , int2 , (select count(*) from big_table_with_millions_of_rows where id between t.int1 and t.int2) from myTable t where .... This select returns exactly one row. The id used in the inline select is an indexed column (primary key). If I replace t.int1 and t.int2 with the values...

Mysql server does not support 4-byte encoded utf8 characters

I got a server error running a Data transfer component from Sql Server to MySql db. Error message reads as follows: [MySql][ODBC 5.1 Driver][mysqld-5.0.67-community-nt-log]Server does not support 4-byte encoded UTF8 characters. Source Sql Server table contain nvarchar columns, target MySql table contain varchar columns. Any expert she...

Application creating user account in MySQL

I am creating a C++ application the uses a MySQL database. I would like the application to create an account for itself, if possible. I have not found a method to do so. Everytime I port my application, I forget the set up sequence. The current set up sequence requires creating an account in MySQL for the application to use. Once ...

Rails fake deletion of a row

I'm looking for a way to faux-delete rows from a table using Rails. The rows shouldn't show up in any normal .find() search except for when I want to show recently deleted items. I'm using an Activities table right now for management of such tasks, which stores the class, id and method performed on rows recently. Is there a way to disab...

How do I lock a MySQL DATABASE so that write/read/update/delete ..everything is locked?

I want to lock everything--completely. Very simple. Just prevent things from changing!! Will this work? use mydatabase; flush tables with read lock; ... unlock tables; Edit: But, it has to be available for replication. ...

Connecting to MySQL with Tcl

Hello: I had a question about where a MySql database has to sit for a Tcl application to read it. Currently, I have a Tcl application that reads off of a sqlite database. For the application to find the database, the Sqlite Db must be located in the same folder as the Tcl application. I am planning on upgrading the Sqlite Database t...

Subversion Access Control using Mysql and Apache (mod-dav-svn, mod-auth-sql, apache, mysql)

Hi, I am trying to configure a site on my Apache server to use mod_dav_svn with mysql authentication. I am using a database with three tables like this auth_users ---------- uid username passwd 1 UserA pass 2 UserB pass . auth_groups ----------- gid group 1 repo_rw 2 repo_ro . users_groups ui...

Zend_Db and Date Based Queries

I'm using Zend_Db to query a table. I have some WHERE clauses that need to be dates and it's not clear (at first glance) how to do this "the right way". Does Zend_Db provide an abstraction so I don't need to concern myself with how the backend (Oracle, MySQL, etc.) expects its dates? Or do I need to format things in the way my backend ...

PHP, MySQL - would results-array shuffle be quicker than "select... order by rand()"?

I've been reading a lot about the disadvantages of using "order by rand" so I don't need update on that. I was thinking, since I only need a limited amount of rows retrieved from the db to be randomized, maybe I should do: $r = $db->query("select * from table limit 500"); for($i;$i<500;$i++) $arr[$i]=mysqli_fetch_assoc($r); shuffle($arr...

Parse error help, PHP unexpected T_STRING (probably something simple)

It's probably something simple I am not seeing because I've stared at it too long. Any ideas? It's throwing on line 119, I've indicated it below Parse error: syntax error, unexpected T_STRING in /home6/cleanai4/public_html/act.php on line 119 I'm just trying to format a phone number. Thanks for the help in advance. if(isset($s...

I exported via mysqldump to a file. How do I find out the file encoding of the file ?

Given a text file in ubuntu (or debian unix in general), how do I find out the file encoding of the file ? Can I run od or hexdump on it to fingerprint its encoding ? What should I be looking out for ? ...