mysql

Php/ODBC encoding problem

I use ODBC to connect to SQL Server from PHP. In PHP I read some string (nvarchar column) data from SQL Server and then want to insert it to mysql database. When I try to insert such value to mysql database table I get this mysql error: Incorrect string value: '\xB3\xB9ow...' for column 'name' at row 1 For string with all ASCII chara...

selecting more than 1 table to get content from [php/Mysql]

Hi There i want to get the latest threads/messages i made my code then i made function that calls the code to show last messages in specific board it works great now i want to get latest messages from 2 boards or more in the same function this is the part that chooses the board AND b.id_board = t.id_board' . (empty($vars) ? '' : '...

installing mysql on mac os x 10.4 powerpc

Hi, I have an old Mac G4 PowerPc, running OSX 10.4.11 MySQL no longer has DMG installation package for PowerPC. I would like to install MySQL on this machine - What's the best way to go about it? This machine currently does not have an install of mysql. Thanks ...

can use more than 1 column in MySQL Group BY?

Hi, I want write these SQL Query: CREATE VIEW `uniaverage` AS SELECT `averagegrade`.`mjr`,`averagegrade`.`lev`, AVG(`averagegrade`.`average`) AS `uniAVG` FROM `averagegrade` GROUP BY `averagegrade`.`lev`, `averagegrade`.`mjr`; But MySQL Query Browser give this error: Operand Should Contain 1 column(s) I somewhere read...

Is 'second' a keyword in mysql full-text searches?

I have a simple MySQL table that is setup for full text search. | id | title | ---------------------- | 1 | test event | | 2 | Second test | | 3 | Larry's event | | 4 | this second | When I use the query: SELECT * FROM EVENTS WHERE MATCH (title) AGAINST ('test event' IN BOOLEAN MODE); I get back 3 rows; the one...

Creating a Mysql view to SELECT coloumns from different tables

I need help in constructing a VIEW on 4 tables. The view should contain the following columns: ER.ID, ER.EMPID, ER.CUSTID, ER.STATUS, ER.DATEREPORTED, ER.REPORT, EB.NAME, CR.CUSTNAME, CR.LOCID, CL.LOCNAME, DI.DEPTNAME The aliases are: EMP_REPORT ER, EMP_BIO EB, CUST_RECORD CR, CUST_LOC CL, DEPT_ID DI The data models are: describe E...

Form Submitting Incorrect Information to MySQL Database

I've created a form that submits data to a MySQL database but the Date, Time, Year and Month fields constantly revert to the exact same date (1st January 1970) despite the fact that when I submit the information to the database the form displays the current date, time etc to me. I've already set it so that the time and date fields automa...

Problem with ajax and posting non-latin characters

Posting non-latin based languages with ajax + jquery doesn't save to mysql the correct text. What I have done is this: I am getting multiple translated words from Google's translation api. The ajax request is showing the correct translations for all languages. But when i try and insert this into the db it shows up in php my admin as g...

Problem starting up mySQL

I just downloaded PHP and I tried running mySQL with the command: C:\Program Files\EasyPHP-5.3.2i\mySQL\bin\mysql.exe And I got the error: ERROR 1045 (28000): Acess denied for user 'ODBC'@localhost' (using password: YES) I found a solution online with linux, but I'm running vista on this machine and have no clue what all of that me...

WHERE id IN doesn't work in UPDATE

UPDATE statistics' SET money = money + '$money' WHERE member_id IN ((SELECT member_id FROM races WHERE l_id = '$mem_id'), $other_id) What's wrong with that? I want to retrieve all member_ids from races and also include to member_id $other_id. Without $other_id it works. By the way, it gives me "Subquery returns more than 1 row" error....

PHP escape $ sign and echo a string my fetching database

Hello, I want to know how to echo a string that have a $ sign from a database. At this time, the value on database 'Buy one for $5.00' converts to 'Buy one for .00'. Let's say the name of the field is title and the value is Buy one for $5.00 <?php $body_tpl = file_get_contents('tpl.html'); //Title is: %title% blah blah %title% $row ...

MySql set charset for ruby

I am using the MySql class in ruby with MySql.real_connect etc. Is there a method to set the mysql charset just like mysql_set_charset in php? ...

Is it necessary to write ROLLBACK if queries fail?

I write mysql_query("SET AUTOCOMMIT=0"); mysql_query("START TRANSACTION"); before I write all queries. Then check if all of them are true and then write: mysql_query("COMMIT"); But if one of query fails, I just pass COMMIT query. So do I really need ROLLBACK function if one of the queries fail? Because without ROLLBACK it also works....

Question about joins and table with Millions of rows

I have to create 2 tables: Magazine ( 10 millions of rows with these columns: id, title, genres, printing, price ) Author ( 180 millions of rows with these columns: id, name, magazine_id ) . Every author can write on ONLY ONE magazine and every magazine has more authors. So if I want to know all authors of Motors Magazine, I have to ...

displaying search results of more than one word

in my search form, if the user types 'good', it displays all the results which contain the keyword 'good'. however if the user types in 'good sweetest', it displays no results because there is no record with the two words appearing together; BUT appearing in an entry at different places. for example, the record says: A good action...

database design - empty fields

Hey, I am currently debating an issue with a guy on my dev team. He believes that empty fields are bad news. For instance, if we have a customer details table that stores data for customers from different countries, and each country has a slightly different address configuration - plus 1-2 extra fields, e.g. French customer details may...

Having a problem inserting into database

I have a stored procedure: CREATE PROCEDURE busi_reg (IN instruc VARCHAR(10), IN tble VARCHAR(20), IN busName VARCHAR(50), IN busCateg VARCHAR(100), IN busType VARCHAR(50), IN phne VARCHAR(20), IN addrs VARCHAR(200), IN cty VARCHAR(50), IN prvnce VARCHAR(50), IN pstCde VARCHAR(10), IN nm VARCHAR(20), ...

How to version control data stored in mysql

I'm trying to use a simple mysql database but tweak it so that every field is backed up up to an indefinite number of versions. The best way I can illustrate this is by replacing each and every field of every table with a stack of all the values this field has ever had (each of these values should be timestamped). I guess it's kind of li...

How do I show the print with AJAX/jQuery?

So I'm trying to understand this whole AJAX/jQuery thing. Right now, when I run this PHP script alone, I would have to wait and watch the wheel spin until it's done with the loop and then it will load. while ( $row = mysql_fetch_array($res) ) { postcode_to_storm( $row['Test'] ); $dom = new DOMDocument(); @$dom->loadHTML($re...

Python fCGI + sqlAlchemy = malformed header from script. Bad header=FROM tags : index.py

I'm writing an Fast-CGI application that makes use of sqlAlchemy & MySQL for persistent data storage. I have no problem connecting to the DB and setting up ORM (so that tables get mapped to classes); I can even add data to tables (in memory). But, as soon as I query the DB (and push any changes from memory to storage) I get a 500 Int...