Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Warning: Mysql_data_seek(): Offset 0 Is Invalid For MySQL Result Index 2


I only posted this on the MySQL forums becouse i believed it had to do with the query.

I get the following error:

Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index 2 (or the query data is unbuffered)

mysql_data_seek is used in a function (made not by me) which i know 500% that it works for other queries.

The query in PHP is this:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Can I Determine The Offset Of A Result In An Ordered Result Set?
How can I determine the offset of a result in an ordered result set?

I would like to pass the calculated offset into the limit half of and ordered select statement.

E.g. I have a table that records a id and datetime for captioned photographs. I'd like to show the five photos that were taken after the photo with id=23.

To do that I need to find the offset of photo with id=23 in

select id, datetime, caption from photos order by datetime;

Then I could get the result I want by doing....

select id, datetime, caption from photos order by datetime limit $offset, 5;

I've spent several hours scouring around and found some people with similar problems, but no solutions yet.

Warning: Mysql_numrows(): Supplied Argument Is Not A Valid MySQL Result
I setting up my mysql-server and php on IIS6 and it works almost fine.
But I got the next error:

Warning: mysql_numrows(): supplied argument is not a valid MySQL result
resource in file.php on line 46.

But I'am sure that the code is good, because I have use the code very much.
Create a connection is working, mysql_query is working but
mysql_Numrows($query) is not working:..........

Warning: Mysql_num_rows(): Supplied Argument Is Not A Valid MySQL Result Resource
I am trying to find out how to fix this error message. Any experts care to help?

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/esewebde/mrsmays.com/include/mysqlclass.php on line 36
::1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from order_customers where seq = 2020' at line 5 select seq, invoice_no, first_nm, middle_nm, last_nm, phone, state, email, subtotal, tax, ship_method, grandtotal, status, a_comments, DATE_FORMAT(reg_dt, '%Y/%m/%d') AS reg_dt, from order_customers where seq = 2020::: SQL Execute Fail...

Warning: Mysql_num_rows(): Supplied Argument Is Not A Valid MySQL Result Resource
I don't know very much having to do with MySQL, so I've managed to get myself stuck and can't figure out a solution.

I'm trying to make it so a user can search a table for keywords and it will return results that match. I'm getting hung up either on the query or the part where I'm counting up the number of results.

I'm also not sure that the order by part is correct.....

Warning: Mysql_fetch_array(): Supplied Argument Is Not A Valid MySQL Result Resource
I'm using the following code, and get an error out of the while statement. I'm simply trying to pull a row from a table and echo it onto a webpage.

<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","INFO","INFO");

//select which database you want to edit
mysql_select_db("jzie0com_gctc");

//select the table
$result = mysql_query("select * from members");

//grab all the content
while($r=mysql_fetch_array($result))
{
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns

$firstname=$r["firstname"];
$lastname=$r["lastname"];
$address=$r["address"];
$city=$r["city"];
$state=$r["state"];
$zipcode=$r["zipcode"];

//display the row
echo "$firstname <br> $lastname <br> $address <br> $city <br> $state <br> $zipcode <br>";
}
?>

Places I put INFO are correct, just hiding them from view here.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

Not sure what this is about...read it off a Spoono tutorial...but it doesn't work.

PHP version 4.3.10

Invalid Index
I try to used the MyPhpAdmin 2.8.2.4 with PHP 4.4.4, MySQL5.0.2.4 and Apcache2 and I got this error, 'invalid Index'

Multiple Index Warning From PHPMyAdmin
Using PHPMyAdmin and it is very usefully reporting problems with my
MySQL DB.

"PRIMARY and INDEX keys should not both be set for column
`column_name`"

and

"More than one INDEX key was created for column `column_name`"

1) Will these warnings have a great impact on the speed of my DB?
2) Can I expect a performance improvement if I do fix them?

This probably stems from a few holes in my knowledge of indexes. I
understand what they do in principle but still a bit confused about
best implementation practises and can't find a useful online resource
to explain.

3) Can anyone point out a good guide on MySQL indexes and more details
on these warnings - particular with regard to multipe column indexes
and when these are useful.

Row Index In The Returned Result Set?
suppose table t has three rows, such that "select letter from t" returns

A
B
C

Is there a way to to return the row index of the record returned in the result set such that we get ("select row(), letter from t" possibly) ?

1 A
2 B
3 C


Invalid Characters With PHP And MySQL
I am writing about a situation that our client is currently experiencing with Linux Mandrake, Apache, MySQL and PHP. We successfully deployed a website running on this type of system for a period close to two years. It has a HTML GUI component that the client can type or paste content into and it serves-up dynamic pages in PHP from a MySQL database. Recently the web site was hacked by the Travel Bug virus and it forced the client to restore the web site and server software mentioned below.

Original Install
Mandrake 8, MySQL 3.23.32, PHP 4.0.06 and Apache 1.3.26-x.x

Current Install
Mandrake 9.0, MySQL 3.23.52-1, PHP 4.2.3-1.1 and Apache 1.3.26-6.1

The current install has lead to new problems. Content with double and single quotes are showing up as squares or question marks. For example, I have a page that is showing the square symbol in place of double quotes. If I do a view source on that specific page I can see the double quotes but if I telnet into the server and query the MySQL record belonging to that page the square or double quote character is nowhere to found. The following items are the steps we tried to understand why this is happening.

First, we did the following to test the integrity of the MySQL backup file. We Restored the MySQL database on our test environment which has the original software specs mentioned above but on a window server running IIS not apache. I did a restore of the MySQL database file and did not get any invalid characters. Even though the environment isn’t completely identical to the clients we can make the assumption that the dump file wasn’t corrupted.

Second, possibly content editors were copying and pasting from word into the HTML GUI component thus creating these invalid characters. In most cases yes but I personally noticed the invalid character issue with a page that doesn’t use the HTML GUI component.

Third, Possibly the configuration especially the character set from the original version to the current version of MySQL is not configured correctly. We believe this to be the primary issue. The resolution is to configure or reinstall MySQL and restore from backup.

Fourth, has anyone tried the PHP functions to convert the invalid characters. A request was to look into the iconv() function. The iconv library functions convert strings between various character sets encodings. This involves compiling the PHP interpreter which is why I haven’t tested it.

Fifth, Can some other process running on the server be causing this?

Altogether, we soon will begin creating a test server identical to the original settings and step through the install and try to recreate the invalid character issue. But, if anyone has experienced this invalid character issue or has more information that would benefit us your help would greatly be appreciated.

Invalid MySQL-Link Resource
I'm getting the error message 'Supplied argument is not a valid MySQL-Link resource' (applies to the 3rd line of code) when the code below executes:

$delete_part_no_query = "DELETE FROM prices WHERE part_no == '$part_no_to_delete'";

$delete_part_no_result = mysql_query($delete_part_no_query);

$num_delete_part_no_result = mysql_affected_rows($delete_part_no_result);

The query works fine and I'm under the impression that 'mysql_affected_rows' should be used to return the number of rows affected by DELETE. However, I keep getting the above error message.

Mysql 5.027 Warning #1264
Warning: #1264 Out of range value adjusted for column 'percent' at row 1

when i enter 100.00 for the value in my percent field it doesn't insert it as 100.00 but 99.99 then gives me the error Warning: #1264 Out of range value adjusted for column 'percent' at row 1

it was working fine in 4.0 but since my host upgrade to 5 it throws the error.
i've tried to search on google but couldnt find anything.

the field percent is double 3,2 i've tried to change it to decimal 4,2 or double 4,2 and it still doesn't work

MySQL Workbench Warning
I will tell you why, I just started using it. Synched up with my database and it deleted all my tables. Every single one of them. Guess what the best part is ... the program didn't store anything. Nope, nothing. So all my data. Gone. All my backups ... gone.
So now, I gotta remember 60+ tables and what they had in them and everything about them. Does MySQL have a recovery feature?

I would highly suggest NOT using this program.

MySQL Warning Error When User Searches For ''
I have a form where a user can do a search.  If the user types in '' (slash character), I get the following error below.  What is the problem here?

Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/httpdocs/ajax/do_search_users.php on line 23

The full SQL related to this error is:

SELECT Users.`Index`, Users.ProfileName, Users.PrimaryEmail, Users.FirstName, Users.LastName FROM Users WHERE Users.ProfileName LIKE '%\%' OR Users.FirstName LIKE '\%' OR Users.LastName LIKE '\%' OR Users.PrimaryEmail = '' ORDER BY Users.ProfileName, Users.LastName, Users.FirstName, Users.PrimaryEmail LIMIT 10;

Alternatively, I have a different search form where I can search for '' and not get an error.  This non-erroring SQL is below.  Why does this SQL statement not error?

SELECT Movies.`Index`, Movies.Title FROM Movies WHERE Movies.Title LIKE '\%' UNION SELECT Movies.`Index`, Movies.Title FROM Movies WHERE Movies.Title LIKE '% \%' LIMIT 10;

How does someone normally handle this when building an SQL statement?

Warning: Mysql() [function.mysql]: Access Denied For User 'apache'@'localhost' (using
my script is not connecting to my database, i get this error

Warning: mysql() [function.mysql]: Access denied for user 'apache'@'localhost' (using password: NO)

Warning: Mysql_query(): Can't Connect To Local MySQL Server Through Socket '/tmp/mysql.sock' (2)
I'm trying to connect to my MySQL database (sitehosted by GoDaddy) using PHP. I am having these errors and don't understand what they mean

Warning: mysql_query(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 6
Warning: mysql_query(): A link to the server could not be established in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 6

Notice: Query: SELECT * FROM types MySQL error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 6
here4
Warning: mysql_close(): no MySQL-Link resource supplied in /home/content/n/l/a/nladmin/html/v5.0_3/c_register.php on line 13

I've checked paths and connection settings and don't see any problems. My guess is now that the problem is coming from the opening and closing of the DB. my script, c_register.php uses a require_once('../mysql_connect.php') to open the connection to the database. But I also have a function definition in c_register.php that uses require_once('../mysql_connect.php') when called because it needs a connection to the DB. Here's a visual that might help:

Newbie Warning: Learning MySQL/Ruby, Priorities?
I've pretty much decided on learning Ruby as my first server side language, and obviously SQL to go with it. Not knowing how the two inter-operate, I'm unclear as to which would be more appropriate to learn first, for someone who is already fairly thorough in Javascript/DOM.

I'm concerned that if I get into one, I'll get stuck because I don't know the other, so I'm trying to decide on how to proceed without becoming dependand on a language i am yet to learn during the process.

So the question would be, MySQL or Ruby first? Or maybe a book/tutorial that nicely fits the two together from the ground up?

Warning: Mysql_connect(): Can't Connect To Local MySQL Server
I have everything configured ready for a drupal install,

but I get this error?

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/i/n/s/insidesam/html/drupal/includes/database.mysql.inc on line 31
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Warning: Your Privilege Table Structure Seem To Be Older Than This MySQL Version!
I am using Yahoo's GeoCities Pro Hosting and when I get into "MyPHPadmin" to view my databases I get the following message.

Warning: Your privilege table structure seem to be older than this MySQL version!
Please run the script mysql_fix_privilege_tables that should be included in your MySQL server distribution to solve this problem!

How can I get to the script?? Can't find it.

Minus Offset...
Been thinking for a while. I need to get the last 6 results from a table (easy) and echo them with an image. I then need every other result except these 6 to be echoed out. but with out an image.

I was hoping there would be some sort of minus offset function? ...

Primary Key Offset
I have a table that contains a smallint primary key that is auto
incremented. I would like to start this table's seed value at 1000. I
thought that I could do this...

ALTER TABLE `servers` CHANGE `server_id` `server_id` SMALLINT( 4 )
DEFAULT '1000' NOT NULL AUTO_INCREMENT

But that does not seem to work.

Could anyone shed some light on how I can change the start value of an
auto increment integer?

OFFSET Clause?
I want to be able to specify only an offset without a limit I currently use this and it works good but I'm wondering if there is an OFFSET clause or something to do it mysql way

"SELECT * FROM 'yazilar' WHERE tur = 'estetik' LIMIT 5, 999999999999999"

How To Use Limit And Offset
1)I'm confuse by what I was reading about offset. What exactly does offset do, is it the first record to be diplayed?

2) Suppose I have 3 fields in my database table called A, B, and C respectively. Can I use Limit and Offset to display data from all three fields by doing the following:

SELECT A,B,C FROM myTable LIMIT 10 OFFSET 10

3) Is the following allowed in mysql ("Select ResumeID,Resumes,DocType, from tb_content where Profession = '" & LBoxProfessions.Items(i).Text & "' Limit 10 Offset 10", mystring)

4) If I do not know how many records exist in a particular field of my data base, and I need all of them displayed, 10 records per page, what would my select statement look like?

Limit Offset
I want to limit a query to the last ten rows. Is this possible without changing the order? I was hoping a negative offset would work, but it doesn't I specifically want the order descending so I don't have to reverse the order later using PHP.

I'm actually query something by dates and I want the dates in chronological order and I only want the most recent results. I could use WHERE with some date calculations, but it would be easier to manage if I could count backwards.

Timestamp Offset
I have a field in my database that is a timestamp. I am using phpmyadmin to manage the db.When I look at the structure of this field, I set the Browser Transformation to text/plain: date format, which makes the time stamp more readable.
How do I set the time offset to make it my local time? Would I put the offset in the transformation options box? If so what's the format?

Ranges With Offset
I have a table with a date and an hours field. These two pieces of information represent a range of time. I also have
a start and an end time.
I want a mySQL query that wil get me all the records that have part (or all) of their range between the start and end time.
What I have now is this (for example, the query will be automaticly generated):

Code:

SELECT * FROM meterprod WHERE Start BETWEEN '2008-04-20 00:00:00' AND '2008-04-20 23:59:59';

Not much, but I have no idea where to go from here.

Easiest Way To Offset With Date_format?
i want to change all the displayed times (queried from the database) to be offset by a variable number of hours

here is my current selection of a date

(an example myDate: 2007-11-08 11:58:52)

SELECT *, date_format(myDate, '%a %b %e, %Y, %h:%i %p') AS formatDateTime

here is what i tried to do unsuccessfully:

$offset = '-1';

SELECT *, date_format(dateadd("h",$offset,myDate), '%a %b %e, %Y, %h:%i %p') AS formatDateTime

ive looked around online and found convoluted ways of doing an offset, by exploding a datetime, doing the calculations, and re-imploding it - i don't want to have to do this for every query in my application - is there a way to easily offset nested inside of a date_format?

Appending Data To An Offset
Is there any way to append data to an existing data field,without overwriting the data that is already there, lets say I wanted to append some data at an offset of 3 characters into a data field? Perhaps something like this: UPDATE mytable SET SUBSTRING(column1, 3)='hello there' WHERE column2='123';

That would insert the data 3 characters into the field and would not overwrite the data already there. One could actually replace a substring of data in the field by simply specifying the length of the substring in addition to the offset:

UPDATE mytable SET SUBSTRING(column1, 3, 4)='hello there' WHERE column2='123';

This is an essential feature for many purposes, such as uploading data into LONGBLOBs. If you need to get hundreds of megabytes of memory you cant load that all into memory at once, it has to be sent in chunks. The user really needs to be able to do this manually with SQL syntax, since even if a database driver could access a local file and send the data to the server as chucnks automatically, the database driver wont know about all of the sources that a user may want to send data from, perhaps the user has some other unusual data source, besides files.

Offset To Geometry Field
I am working with MySQL 4.1 and I got a table with a point field. I
need to do an "offset" in all the points, that is, adding some deltaX
to the X coordinate and a deltaY to the Y coordinate.

Easy Way To Get Time Zone Offset
I need to get the standard offset value from GMT for any given time zone name in the mysql.time_zone_name table. Is there an way in MySQL to do this?

For example:
I have 'US/Eastern' time zone. I know that the value I'm looking for is -5. How can I get this out of MySQL. I don't care about DST offset, just standard time offset.

Warning: Mysql_connect() [function.mysql-connect]: Access Denied For User 'debscrof'@'localhost' (using Password: NO)
Have MySQL on a VPS running CPanel
MySQL v4.1.22-standard

Can access MySql fine through CPanel, phpMyAdmin etc all work fine, creating databases, deleting databases, adding users etc

However, when I try to use MySql from a website, it fails

I created a user "test1" (which then got the username "debscrof_test1" from CPanel), a password for the user "test2", and then added the user to a new database "testdb" with all priviliges

Then a simple script to connect to the database (as I am trying to locate the source of the errors), as per below:

<?php
$dbhost = "localhost";
$dbuser = "debscrof_test1";
$dbpass = "test2";
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'debscrof_testdb';
mysql_select_db($dbname);
?>

Have tried with " and ' around the values, with 127.0.0.1 as the host... still with the same error message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'debscrof'@'localhost' (using password: NO) in /home/debscrof/public_html/testdb.php on line 6

Error connecting to mysql

...any suggestions why I cannot connect? (and why it says password: NO)!

Update Based On Row Offset From Begining Of Table?
Is there a way to update a table row based on its offset from the begining of the table. I want to be able to update based on a rows position when its brought up when all rows in a table are selected. ie; select * from table.

Invalid Use
I am having a problem with group. Following is my query but it gives an error of "Invalid use of group".

SELECT refMember.MemberAcroName, refMember.MemberName, Count(DistrictLevelInformation.FormID) AS Spread
FROM (refMember LEFT JOIN MainInformation ON refMember.MemberID = MainInformation.MemberID) LEFT JOIN DistrictLevelInformation ON MainInformation.ID = DistrictLevelInformation.FormID
GROUP BY refMember.MemberAcroName, refMember.MemberName, MainInformation.qYear, MainInformation.Quarter
ORDER BY MainInformation.qYear DESC , MainInformation.Quarter DESC , Count(DistrictLevelInformation.FormID) DESC

Invalid Use
I have tested my query on MySQL 5 and it works, sadly the server it is to be run on only has 3.
I was just wondering what I need to update in the following query to get it working on 3 or if it is even possible to get it running on 3.


Code:


.....
and keyword IN ('keywords')
group by
people
having count(*) >= 1
ORDER BY people ASC

Invalid Use Of Group By
I have the following query:

SELECT CLAIMPOLICYNUMBER AS Plan, PROVIDERSPECIALTY AS Specialty, TINNUM AS Tin, SUBTINSEQNUM AS SibTin, CHARGETYPECATEGORY AS ChargeCategory, SUM(BILLEDCHARGE) AS Billed, SUM(PAID) AS Paid, " + _
COUNT(DOCUMENTNUM) AS ChgCount
FROM BAT
WHERE CASENUM='0000911'
AND CHARGETYPE <> 'DENTAL' AND CHARGETYPE <> 'VISION' AND CHARGETYPE <> 'ADMIN'
AND PMTDATE >= '2005-06-01' AND PMTDATE <= '2005-06-30'
GROUP BY CLAIMPOLICYNUMBER, PROVIDERSPECIALTY, TINNUM, SUBTINSEQNUM, CHARGETYPECATEGORY
ORDER BY SUM(BILLEDCHARGE)

It works great without the ORDER BY clause, but with it, I get the aforementioned error.

Directory Name Invalid
For testing purposes I have PHP installed and I have MySQL installed on my local laptop. Windows XP Pro

I am just learning both of them. I have read quite a few chapters in the MySQL Manual. Enough to allow me to get around in MySQL and directly create tables an view information in them, upload .txt files into the tables, etc etc.

I am receiving an error when I try to connect to MySQL via a PHP script.
I have no problem connecting to MySQL via Command Line.

The error I receive is "The directory name is invalid."

Here is my code... I am not sure where to put the directory name or where to put the directory path in order to make it valid. I am not sure what directory it is talking about.

<html>
<head><title>Connect to MySQL</title></head>
<body>
<?php
//connecting to the mysql server uses a mysql_connect command.
$link = mysql_connect("locoalhost",$_POST['username'],$_POST['password']) or die("Connect Error: ", . mysql_error());
echo 'Successfully Connected.
';
mysql_close($link);
?>
</body>
</html>

Where exactly would I put the path to the directory or where would I name the directory?

Invalid Syntax
I am having trouble changing my password back to OLD_PASSWORD by the following :

mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

When I do it, it says
ERROR 1064: 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 'OLD_PASSWORD ('newpwd')' at line 2

Invalid Use Of Group Function
I have the following Sql Statement... I'd like to find the sum of hrs worked by an employee in the month, the required number of hrs, and the sum of the difference between the two, the worked hrs are calculated by subtracting the max vtranstime - min vtranstime and the required hrs are calculated by subtracting max to1 - max from1....

I tried to do the following:

select sum(timediff(max(vTransTime),min(vTransTime))) as worked,
sum(timediff(max(translog.to1),min(translog.from1))) as required,
sum(timediff(sum(timediff(max(vTransTime),min(vTransTime))),
sum(timediff(max(translog.to1),min(translog.from1))))) as overtime,
empid,deptname, firstname,lastname from employee,translog,department where
employee.emp_magnetic_num=translog.vId
group by employee.empid
I am getting the following error :
Invalid use of group function

Invalid Backup File
I am tring to restore a .pmb backup file and getting the message "Invalid backup file". I am very new to myssql so I don't have a clue what that means. Wrong version of mysql? Corrupted file?

Invalid Use Of Group Function
Using mysql 4.0

I get the following error message

"Invalid Use of group function"

with the following code:

update custRP c, tbl_acctbal a
set c.rpBal = sum(a.currRPBAL)
where c.custid = a.custid

Invalid Argument While Using BCP (Script)
This will be a 50/50 question. It's either something that the SQL experts can answer or a scripting forum. I'm new to SQL and just coming to grips with getting familiar with scripts. I've developed a small script for my workplace that will connect to a remote server and extract the specified table that I want, zip it up and then copy it back to my local machine. This works fine until it tries to run the bcp command.
If I tivoli to the remote machine and type the bcp command in command prompt it works fine. However when executed from the script it throws an invalid argument and seems to refer to the "-" minus I place in front of the U (user) or P(pwd). The script echos the users table request to a file which is then copied to the remote server (SQLtable.cmd) and then PSEXEC is called to connect to the server and run the script. e.g. psexec \%Server% -u %user% -p %password% "C: empSQLtable.cmd"
PSEXEC then returns the following error.

C:WINNTSYSTEM32>Bcp FrontOff..SHIFT_TER_DATA out C: empdmpnlSHIFT_TER_DATA.dat ûUsa ûPpwd (chopped off the -n)
Unknown argument '¹Usa' on command line.

Sorry about all the data, just hope someone can help. Must be an easy way. The small script which psexec is executing contains two simple lines. Bcp FrontOff..SHIFT_TER_DATA out C: empdmpnlSHIFT_TER_DATA.dat -Usa -Ppwd -n
wwzip -9 C: emp\%username%SQLtables.zip C: emp\%username%*.*

Invalid Use Of Group Function - Max(`mainid`)+1
I am trying to insert a incremented number into the menu table. I will have an autoincremented number as well as the mainid number. When I tested the code that is below, the above error happened. Can someone please tell me the correct way of doing this? I am getting really frustrated with this. Nothing wants to work for me.

require "config.php";
$insert06 = "INSERT INTO `menu` (`mainid`)
                VALUES (max(`mainid`)+1)"; // error line
if (mysql_query ($insert06)) {
    print "Mainid added.";
    $query2 = mysql_query("SELECT mainid FROM menu") or die ("Could not query because: ".mysql_error());
    while($row2 = mysql_fetch_array($query2)) {
        echo $row2['mainid']." = Mainid";
    }
} else {
    print "<p>Could not add the entry because: <b>" . mysql_error() . "</b>. The query was $insert06.</p>";
}
mysql_close();

Group By Returns Invalid Dates
Hi i have one table:

ID, User, Score, Date
1, mac, 1234, 2007-12-09 09:01:07
2,kurca, 3232, 2007-12-05 09:43:57
3, mac, 999999, 2007-11-07 09:44:14

I wan to create a high score list which will represent the best scores but not repeating anyone for example:
1, mac, 999999, 2007-11-07 09:44:14
2,kurca, 3232, 2007-12-05 09:43:57


Now i use:
SELECT ID, User,MAX(Score) as maxScore,Date
FROM `table`
GROUP BY User
ORDER BY maxScore DESC

with this query the score is right but the date is invalid example:
1, mac, 999999,2007-12-09 09:01:07
2,kurca, 3232, 2007-12-05 09:43:57

Strip Invalid Char From Tables
Just wondering if anyone knows a way I can run a query to strip out commas from a table?

Table Join Invalid Query
I have this table join below and I am getting an invalid query. How can I put the 15th line ($sql .= " group.id = master.id
"; and the 17th line ($sql .= " where ".$currentrow_sql ; together. Is it even possible to do that?

Invalid Access To Memory Location.
I have a hosted account - I'm getting this error now..... Any reason that I can hunt down to figure out why I should be getting it?

Error:invalid Use Of Group Function
version:mysql 4.0.18 for win

hi,all dear:)

when execute sql-statement,
error raise:

update customer,cu_order set customer_point=0
where customer_keyid=order_customerid and
DATE_SUB(now(),INTERVAL 1 YEAR)=DATE_FORMAT(max(order_time),"%Y-%m-%d 23:59:59")

error:invalid use of group function

i beg someone tells me why?how resolve?

thx

Valid/Invalid Column Names
I'd like to present tabular data in HTML with the first row being the names of the columns in my database. However, I'd like them to be more presentable; for example 'I.P. Address' instead of 'ip_address'. I was wondering if a name like 'I.P. Address' could ever somehow be a valid column name or not.

Warning
im getting the following error:

Warning: mysql_connect(): Too many connections in /home/grrrrr/public_html/fxtm/wrapperclass.php on line 25
Too many connections

Has anyone got an idea what the problem is, the script has been working fine for months, just checked it now and seems to be showing this error....

Importing CSV :: Invalid Field Count In CSV Input On Line 1
I was able to import a csv file without any problems, until my server updated phpmyadmin from 2.6.4 pl2 to 2.8.02. now when I try to import the same file I get the following error.

Error:
Invalid field count in CSV input on line 1.


Copyright © 2005-08 www.BigResource.com, All rights reserved