Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Bad Query Runs With No Error!


there must be some weird setting on the mysql database i am using for this latest project. the following query runs without throwing an error:

SELECT start_time, last_access_time, user_ip session_data FROM demo_sessions WHERE id='b31fd40c7e9135f2b52e4f17c23fc3c54da137b8'

notice there is no comma between user_ip and session_data

what's the story here? seems like a real security risk to me because my server won't log bad requests.




View Complete Forum Thread with Replies

Related Forum Messages:
Query Runs In Mysql But Returns Error 1064
The same query runs in mysql and in Zend interface but not runs when using inside php script. I am receiving the 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
'str_qry_Insert' at line 1"

INSERT INTO fnd_script_type (type_name) VALUES ('test1')

I already have tried it with as:

INSERT INTO `fnd_script_type` (`type_name`) VALUES (`test1`)
INSERT INTO fnd_script_type (`type_name`) VALUES (`test1`)
INSERT INTO fnd_script_type (type_name) VALUES (`test1`)

what am i doing wrong ?

View Replies !
Optimizing Query That Runs Slowly On Linux
I was wondering if anyone has any insight into why the query I have posted below runs exceedingly slow on my Linux server. I am using Php with a MySQL database. On both my development computers the query runs briskly. They are however both Windows boxes, one running Windows XP and the other running Windows 2000 Professional. Here is the culprit.....

View Replies !
How Do I Create A Link That Runs A MySql Query When Pressed!!
I Want To Create A Link, And When You Press That Link It Runs A MySql Query.

View Replies !
Query Runs Multiple Times Under Heavy Server Load.
I have been having an issue with some MYSQL queries running multiple times when the server is under a heavy load. 

Example, if I do an 'update Table1 set item1 = 0 where 1 = 1'

This runs fine under normal conditions, but will repeat itself multiple times when the server is under load.  Is this just an optimization or server resource issue.  If so, I would assume the query would just timeout and not run at all instead of running a few times.

View Replies !
Warning: Pg_exec(): Query Failed: ERROR: Parser: Parse Error At ...
I have the following:

$sql= "select shopname from shop where exits SELECT shopname FROM shop where shoptype = '$_POST[option]'";

Its embedded within php. keep getting error:

sportsselect shopname from shop where exits SELECT shopname FROM shop where shoptype = 'sports'

Warning: pg_exec(): Query failed: ERROR: parser: parse error at or near "SELECT" at character 39 . in /home/students/ug/ug75ixc/public_html/shops/storeSearch.php on line 46

i know what i am doing.

View Replies !
Update Query - Cant Execute Query Error.
I am having a problem with the update script. I making a group update and i keep on getting "cant execute query" error. I am wondering if its my SQL statement. PHP Code:

View Replies !
Error Performing Query: You Have An Error In Your SQL Syntax Near
I have a query which pulls user info from a database table, and displays it in an HTML table. The user then has the ability to edit this data on the next page by clicking continue, where the first and last name are passed as variables, and are listed as uneditable, whereas all the other fields are able to be edited through a simple form.

Here's my problem, on the final page where the actual database UPDATE occurs, I'm getting a SQL error that looks like this
---------
Error performing query: You have an error in your SQL syntax near 'WHERE first_name='Joe' AND last_name='Schmoe' SET street_address_1='real address' at line 1
----------

It looks like its passing the first and last name fine (through hidden inputs), yet when I start to pass the edited fields as variables, it cuts off for some reason. The actual full value that I entered for "street_address_1" was "real address 333". It looks like it cut off after the "address", and didnt even bother to send the other 8 fields.

My code on the processing page looks like this
----------
$street_address_1_update=$_POST['street_address_1_update'];
$street_address_2_update=$_POST['street_address_2_update'];
$city_update=$_POST['city_update'];

$sql ="UPDATE mailing_list WHERE first_name='$first_name_update' AND last_name='$last_name_update' SET street_address_1='$street_address_1_update' street_address_2='$street_address_2_update' city='$city_update'"
----------
I only included 3 fields for brevity's sake. The rest pass the same way as these three. Again, the first and last names are simply passed as hidden inputs through the form.
Anybody have any clue what might be causing this? I know the error is a SQL one, but I may not be passing the variables correctly in PHP.

View Replies !
MySQL Query - Error: You Have An Error In Your SQL Syntax
Whats wrong with this query:

SELECT from, subject, message, time FROM user_messages WHERE username='$username' ORDER BY timestamp DESC

I get this error:
QuoteYou 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, subject, message, time FROM user_messages WHERE username='Drezard' ORDER B' at line 1

View Replies !
User Runs PHP
I have an app that uses PDFLib to read some images off the file system (Red Hat linux) and puts them into a PDF. I have permissions set on the directory to be readable by the owner and the group, 'images'.

I made apache a member of the group 'images' but get a permission denied error when trying to read an image from the images directory. Is there some other user that owns the PHP app.

Env.
PHP 5.03
Red Hat ES4
Apache 2.02

View Replies !
Error Message - Error In Sql Query
I have recently uploaded a php script for an autoresponder package.

According to the instructions I have the correct version of PHP and the correct version of mysql on the server.

The insructions are to "run the sql file autoresopnder.sql in phpmyadmin".

Other scripts like this that I have used in the past came with a self installer, so this is new to me. I received an error so I don't know if I did it wrong, or if there is a problem.

I picked the database in phpmyadmin, went to the SQL tab, and typed in the path fo the filename. Here is the error: Code:

View Replies !
PHP Only Runs From Command Line
I know very little about PHP, but I was just curious to know
why exactly would some PHP code run fine from the command line but not
from the browser?

I'm just curious. I was working with someone else's PHP code that
supposedly created MySQL tables in a database and for some reason it
just wouldn't create the tables at all (no specific error message).
Someone suggested I run from the command line and when I did, it
worked...

View Replies !
Cleaning Up After A Script Runs
how do you clear all varialbles and arrays after a script is run?

View Replies !
Fatal Error: MySQL Error: 2013 : Lost Connection To MySQL Server During Query
I am getting the following error:

Fatal error: MySQL error: 2013 : Lost connection to MySQL server during query

View Replies !
Why Script Runs Differently With CRON?
I am running a PHP Script that downloads my RSS News (and the accompanying Thumbnail images)from the Web. When I execute it from CMD line, no problem. The News and Images are downloaded, great!

When I begin to update via CRON, no images are downloaded/written to disk.--I don't have this problem when it's RUN from a shared hosting account, it's only on my home Linux Box.

View Replies !
Bug 23891 MySQL Runs Out Of Connections
http://bugs.php.net/bug.php?id=23891

According to this report, what the person was asking isn't a bug, it's
a feature (rimshot).

I'm running into this problem almost exactly, and really don't
understand what the answer is. The support person snidely suggests
reading the manual, which is always great advice, but in this case
really doesn't help out.

Could someone explain what "If you use mysql_select_db() or slightly
different connection string you can have more open connections then
you have process." means?

If I don't use mysql_select_db, then what do I use?

View Replies !
EXEC() Runs Process In Background
Exec, shell_exec, system, popen functions all run the process in the
background.
how can i get it to run the process normally.
my code looks like this:
<?
exec("batch_file.bat");
?>

am i doing anything wrong?

View Replies !
Close Window After Script Runs
When a user clicks on a link in their email, I have a browser window that opens in the background and runs a script confirming their desire to be added to our email directory. I basically want this window to open, run and then close without the user having to deal with it.

Is there a way in PHP to close the window after the script finishes running in it? Or should I revert to JavaScript? I want the script to be mobile so I've sort of ruled out processing it server side. TIA.

View Replies !
How Often Does Garbage Collector Runs In Sessions?
Does anybody knows how often the session garbage collector checks for expired session to delete them? is it possible to modify this timeframe? is it possible to call this function manually?

I am storing my sessions in a mysql database and i am using a session expiration of 5 seconds (just for testing), but after the session is expired the session record in the db table still exists.

and it looks the sessions aren't expiring either because if you still have the session cookie you can keep up with the session. Code:

View Replies !
Email Form Which Runs From An Iframe
I have set up an email form which runs from an iframe. The only problem is that when the script redirects the user to the success or error pages, these pages open within the iframe. Is there a way to specify the target window as 'parent'? Someone said that this could not be done via the php script and would have to be done with javascript in the html form itself.

View Replies !
Counter - Increased By One Everytime The Loop Runs
i want to make a counter that i can echo. its going to be used in a while loop so i want it to be increased by one everytime the loop runs so each time it runs it would look like this:

counter=1
counter=2
counter=3
etc.

View Replies !
Php Script Auto Runs At Specific Time?
Is it possible to have a php script automatically execute at a certain time without having to visit the page or manually executing the code?
For example, execute test.php every hour?

View Replies !
Switch Statement That Runs Through Cases Numbered 1-100:
I have a switch statement that runs through cases numbered 1-100:

What is the most optimal way to run this switch?

switch($a){

case 1:

case 2:

...
}

View Replies !
MySql Is Loaded When Runs From Command Line, But Not Through IIS
Sorry for the newbie question, but I've been searching and searching and
haven't found an answer to this one yet.

I installed PHP and MySql (both latest versions) yesterday on a machine
running Windows 2003 Server with IIS6. Code:

View Replies !
Header Function Runs Before Update To Database Is Made
I have been having some problems with a part of my login script. This is the two lines of script I am having problems with:

mysql_query("UPDATE " . $userName. " SET login = '$loginIN' WHERE pass = '$password' AND course = '$courseID'");
header( 'url=http://www.somewebsite.com/logged_IN.htm' );

The problem is that when this php script is executed the second line executes before the first and an update to the database is not made. I also tried the script without the second line and the first works then.


View Replies !
POP Account Creation Script On CPanel. Runs Fine On Win2000, Not On Linux.
I am facing a weird problem. This is a POP account creation script. If I run it from my Win2000 PC, it creates the POP account. But when I run this script from the Linux server (CPanel is also on that server), it does not create any POP account.

View Replies !
Working With Dates - Runs And Queries The Database To Produce A List Of Information
I have a script that runs and queries the database to produce a list of information, based on a date range. This is to fllow up on a script that is automatically run each Sunday night.

What I want to try and acheive is, for example, if someone manually runs this report on a Tuesday the script will assume that it is run on the Sunday night, to make sure the results are exactly the same as the emails that have gone out. PHP Code:

View Replies !
Query Error.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/ironmanx/public_html/main.php on line 96

That is the error i get with thequery's i am making.

View Replies !
Query Error
I'm running a query in phpMyAdmin and it works, however when i use the query in my php code i get an error message.

SELECT category.id, category.name, LEFT(category.contents, 400), category.image FROM maincat, maincatcategory, category WHERE maincatcategory.maincatid=maincat.id AND maincatcategory.categoryid=category.id AND maincat.id='$id' ORDER BY category.corder

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 'Resource id #10'

View Replies !
Sql Query Error
select * from ( SELECT ad_title, ad_location, ad_number, ad_timestamp MATCH (ad_title, ad_body) AGAINST ('research' IN BOOLEAN MODE) AS Score FROM ads_live WHERE ( ( ad_type = 'permanent' ) OR ( ad_type = 'contract' ) OR ( ad_type = 'temporary' ) OR ( ad_type = 'part_time' ) OR ( ad_type = 'internship' ) ) AND ( ad_iso_country = 'us' ) LIMIT 50,100 ) as a order by a.a.ad_timestamp DESC:

The error message is:

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 'MATCH (ad_title, ad_body) AGAINST ('research' IN BOOLEAN MODE) AS Score FROM ads' at line 1.

View Replies !
HELP: PHP Search Query SQL Error
I'm trying to run the following search query:

$query =
sprintf ("SELECT itemNumber, thumbnailURL, title, description, price
FROM apparel,hats
WHERE apparel.title OR apparel.description OR hats.title OR
hats.description
LIKE '%s'",
$_POST['tfSearch']);

but it returns this error:

"Column: 'itemNumber' in field list is ambiguous"

Both "apparel" and "hats" tables share the same columns specified in the
SELECT clause.

What I'm I missing?

View Replies !
Error Performing Query:
I currently am making a portal which follows this basic follow:

1. loads db connection info from config.php
2. uses index.php to determine Theme of site, site owner ID, and other data. (This works well and provides all data including meu options, graphics, etc.. from a mysql database).
3. proceed to login screen, which when submitted checks login for valid id

this is where the problem occurs.. in the index and header i use one variable called $dbcnx2 to connecto to the master server hoding the theme, site id, etc.. and it all works.. but the first time I try to select a db from the client's site it give me the error that "Clients" does not exist, but its trying to find it on $dbcnx2 instead of $dbcnx1. heres the code for the login check script: Code:

View Replies !
Query BETWEEN Dates Error
I've been getting an error in PhpMyAdmin when I query between dates. Below is the query I am trying to run:

SELECT * FROM customer
WHERE CRMGUID IS NULL
AND BETWEEN dateCreated "2007-02-02" AND "2007-02-09"

this is the error I am getting: Code:

View Replies !
Insert Query Error
I am trying to run this query:

$query = "INSERT INTO breed_to_attribute (`att_id`,`breed_id`)
VALUES ( SELECT 'att_id','$id' FROM 'breed_to_attribute' WHERE 'breed_id' = '$template' )";

and keep getting this error:

Error: 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 'SELECT 'att_id',&#3978;' FROM 'breed_to_attribute' WHERE 'breed_id' = &#3971;' )' at line 2

This is the basic mysql ststement, which runs fine in phpmyadmin

insert into breed_to_attribute
(att_id,breed_id)
select att_id,&#3977;' FROM breed_to_attribute WHERE breed_id=&#3971;'

The query populates a new row with all the values from an existing row while changing the id. What am I doing wrong? PHP does not seem to want to stop at the end of the query I guess or something.

View Replies !
Error With Mysql Query
I'm trying to get a simple search query of a table of news articles working. But it keeps giving me an error for the "mysql_fetch_array( )" on line 34. I can't see what I've done wrong. Code:

View Replies !
Parse Error When Executing A DB Query
I am attempting to display the results of a MySql db table to a browser. Its obviously very simple, but I keep getting a parse error on this line...

echo("<p>" . $row["QuoteText"] . "</p>"); PHP Code:

View Replies !
Parse Error In Nested Query - Please Help.
I am having troubles finding the parse error in this script. I've been
checking for weeks. I am too new to the subject I guess.

I am trying to show a readord and them have a form at the bottom of the
page for inputting data to Update the record. I get a parse error that
points to the last line in the script so I know it is something I am missing
earlier in the script but doing a line by line it seems fine to me.

------------------------------
<--cut--
$query = "SELECT sub_id, username, story_title, DATE_FORMAT(date_submitted,
'%m/%d/%y'), category, story FROM Submission WHERE date_processed < 1 LIMIT
0,1";

$result = @mysql_query ($query); // Run the query.
if ($result) { // If OK, display the record.

echo '<table align="center" cellspacing="5" cellpadding="1" border="0"
width="500"><span><tr><td align="left" width="100">Story ID:</td><td
align="left" width="100">Name</td><td align="left" width="250">Title</td><td
align="left" width="100">Date&nbsp;Submitted</td><td align="left"
width="50">Category</td></tr><tr><td colspan="5"></span><hr></td></tr>'

// Fetch and print the record.
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo"<tr><td align="left" width="100">"
..$row[0]
.."</td><td align="left" width="100">"
..$row[1]
.."</td> <td align="left"width="250">"
..$row[2]
.."</td><td align="left" width="50">"
..$row[3]
.."</td><td align="left" width="50">"
..$row[4]
.."</td></tr><tr><td colspan="5"width="500"><br>"
..nl2br($row[5])
.."</td></tr>
";
}
echo '</table>'
echo '<hr>'

View Replies !
Query Oci_parse() Apache Error
I get this error, apparently because of my Query:

Apache.exe has encountered a problem and needs to close. We are sorry for
the inconvenience.

the error in on oci_parse() , but when I replace the above query with for
example "select * from clients"; I don't get the error. Though I need to
use query I put in variable $query....

All my other variables are ok, and the query works when I use it in SQL
worksheet for instance. (I use oracle 9i, php5, apche 1.3)

what can I do with that query to make it work?

$req_id = $_GET['request_id'];

print "request id : $req_id <br>";

$req_name = $_POST['request_name'];

print "request_name -> $req_name <br>";

$req_date = $_POST['request_date'];

print "request_date -> $req_date <br>";

$req_client_id = $_POST['request_client_name'];

print "request_client_name -> $req_client_id <br>";

$req_req_type_id = $_POST['request_type'];

print "request_type -> $req_req_type_id <br>";

$req_brand_id = $_POST['request_brand_name'];

if ($req_brand_id=='Brand Name') $req_brand_id='NULL'

View Replies !
Fatal Error Line 49 -- SQL Query.
Alright I got my Pagination to work on my page. But when I try to narrow my rows down to a certain parameter rather than pulling all rows, i get. These are the lines with the errors. You can statements work, and which ones dont. The statements that pull all rows works and I dont get an error. Code:

View Replies !
Parse Error In Update Query
This is the first time I have ever used the update query. I am not having any luck figuring it out. Please post if you find my mistake,

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting

T_STRING or T_VARIABLE or T_NUM_STRING in
[bleeped] on line 46
here is the location of the problem:

$sql = "UPDATE $table
SET pagecontent = $_POST['T']
WHERE id = $_POST['id2']";

View Replies !
Error In Query. No Database Selected
I have an error, not a php syntax error, everything is working fine but I get this error "Error in query. No database selected", does anyone have any idea on how to solve this. 

View Replies !
Mysql Error But Query Still Working
The code below is generating a number of new entries in my tries table, inserting 4 values. When $val contained an integer it worked fine, but I changed it to contain text, and suddenly I'm getting an error. Despite the error, it still inserts the correct amount of new entries in the table. What's going on? Code:

View Replies !
PHP/MySQL: Using MIN() On An Empty Set Of Rows -&gt; Query Error
I'm using: "select min(objid) from table_name where objid > $objid" to select the next row in a sequence where there may be gaps. It works fine unless the where clause results in an empty set.

From the command line, a value is *always* returned, which is NULL when the set of rows selected by the where clause is empty. I wasn't sure what I expected mysql_query to return. I didn't expect a FALSE result, since the query is syntactically valid, but that's what I got.

Surely this is a bug? An empty result set would seem to be the correct response, not a query error.

View Replies !
MySql Query Not Working, Not Giving Error
I'm running the below queries and they don't seem to be working. The code sets the value in "credits" to 0 and the value in "earned" stays the same.

I'm pretty sure that the variables are all correct (As in all of the variables in the queries have a value) Code:

View Replies !
Error Reporting Being Called Even On Successfull Query.
i have this function in my class that i am developing. its a mysql wrapper class. (i know there are lots of these around, but i generally like to write my own code, and since oop in php is new to me, there are lots of examples to learn from Code:

View Replies !
Error In Query: SELECT Uid, Uperms From Users WHERE Uname =
I am trying to set up the article from the main page in devshed called money is time
the thing is this, it denies access for this user and pass even though they are in the database 'example' and on table (users)

Error in query: SELECT uid, uperms from users WHERE uname = 'john' AND upass = PASSWORD('john'). Access denied for user: '@localhost' to database 'example' Code:

View Replies !
Warning: PostgreSQL Query Failed: ERROR: Pg_atoi:
I've built a postgres database that can be controlled through browser inputs to update, insert or delete records. i'm using php to access the db and display results in html. all of my update commands work fine but my inserts will not, each time i try to insert it kicks out this line:

Warning: PostgreSQL query failed: ERROR: pg_atoi: error in "head": can't parse "head" in ....... on line 47

for this example "head" is an attribute of type text which is all set up properly to send and hold the correct attribute type ($tag_method in the sql under here). Line 47 refers to the sql command in my php which looks like this:

LINE 46: $sql="INSERT into sheep values ('$tag_method', $flock_id, '$sex', '$breed' , $age, $parent_id, '$born_on_farm', '$date_joined', $price_paid, $price_sold, $sheep_number)";

LINE 47: $result_set = pg_Exec ($conn, $sql);

View Replies !
MySQL Update Query - Syntax Error Pops Up
I'm using this query for an update form: Code:

$sqlUpd = "UPDATE employee SET fname = '$fname', lname = '$lname', title = '$title', email = '$email', id = '$id', pass = '$pass', all='$all', prepare_user_quotes = '$prepare_user_quotes', manage_jobs='$manage_jobs', manage_users='$manage_users', add_employee='$add_employee', add_process='$add_process', add_news_story='$add_news_story', add_dyk_tip='$add_dyk_tip', create_mail_list='$create_mail_list' WHERE unique_id='$val'" OR die(mysql_error());

but always seem to get a syntax error. I've tried all the available methods, but still syntax error pops up. This is the error I'm getting: Code:

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 'all=&#391;', prepare_user_quotes = &#391;', manage_jobs=&#390;', manage_users=&#390;', add_emplo' at line 1

View Replies !
ERROR 2013: Lost Connection To MySQL Server During Query
I periodically recieve the following error from my MySQL server. "ERROR 2013: Lost connection to MySQL server during query" The server load is always very low (0.06). I can't figure out why I am getting these errors. Here is an extened status report from MySQL.
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| Aborted_clients | 5 |
| Aborted_connects | 340 |
| Created_tmp_tables | 2 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_delete | 25306 |
| Handler_read_first | 23 |
| Handler_read_key | 60061392 |
| Handler_read_next | 40329034 |
| Handler_read_rnd | 3588071416 |
| Handler_update | 33411189 |
| Handler_write | 433799 |
| Key_blocks_used | 7822 |
| Key_read_requests | 485870614 |
| Key_reads | 5508 |
| Key_write_requests | 536763 |
| Key_writes | 103759 |
| Max_used_connections | 152 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 125 |
| Open_files | 84 |
| Open_streams | 0 |
| Opened_tables | 287 |
| Questions | 76301760 |
| Running_threads | 87 |
| Slow_queries | 55 |
| Uptime | 2499787 |
+--------------------------+------------+

View Replies !
Query Error- 5 - Duplicate Entry &#3980;.200.213.102 Mozilla/4.0 (compatible;
I get an error when trying to insert a new row:
query error- 5 - Duplicate entry &#3980;.200.213.102 Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1; Avant Browser [avantbrowser.com]; MyIE2; .NET CLR
1.0.' for key 1

The table consist of timestamp, file, level, ip, naam , ID

Where ID is an autoincrement, unique key.



View Replies !
Memory Size Exhausted Error - Too Much Info Back From Query - What To Do?
I changed one of my MySQL search queries to allow a situation where the user
gets much more information returned.

However, it has now given me the error message:
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 42 bytes) in /usr/share/pear/DB/mysql.php on line 290

OK I understand what this means (I assume) that the program is trying to
allocate more memory to return my query result but it wont let it.

However, I need this query to return this info, so what can I do?

View Replies !
PostGreSQL : Query Failed: ERROR: Must Be Superuser To COPY To Or From A File..
I have a file that I'm trying to import into psql from within my php script: Code:

View Replies !
Fatal Error: Call To A Member Function Query() On A Non-object
When I run the following code I recieve the following error:

"Fatal error: Call to a member function query() on a non-object in /home/mikepar8/public_html/update_record.php on line 65"

The file uploads into the correct directory, but the database is not getting updated. Code:

View Replies !

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