473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

General queries

Hi Guys,

I have some wierd MySQL queries. Although I am using ADODB (an
abstraction layer) - the queries will probably be quite general.

1) When I post data in a url (i.e. post.php?id=120) and I use this
code: $var = secure_field($id); it will work (on the
"recieve_page.php"). However if I use $secure_field($_POST['$id']) or
any POST/GET/REQUEST type option, it won't work. Its fine, because
secure_field does what I need, however I'm just not sure why its not
picking it up. (If I probe $var - the result is blank)

2) I have a table, where I want a delete button at the end of each row
(as opposed to when only one record is displayed on the screen). I also
don't want to have to post to an external delete.php file. Is there a
way to do this?

For example:
print "<tr>
<TD>{$rs->fields[0]}</TD>
<TD>{$rs->fields[1]}</TD>
<TD>{$rs->fields[2]}</TD>
<TD>{$rs->fields[3]}</TD>
<TD><a href='another_page.php?id=$id'>Edit</a></TD>
<TD><a href='this_page.php?id=$id2'>Delete</a></TD>

Where $id = $rs->fields[0]

Even with hardcoded MySQL I have never been able to resolve this delete
per row problem. Any help would be great.

Thanks

Mar 13 '06 #1
1 1226
"UKuser" <sp********@yahoo.co.uk> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
I have some wierd MySQL queries. Although I am using ADODB (an
abstraction layer) - the queries will probably be quite general.
Hmm. You mention ADODB, but the coding questions you are asking involve
PHP. Also, I don't see any MySQL question in your posting. Perhaps you
would get a more specific reply from a PHP newsgroup.
1) When I post data in a url (i.e. post.php?id=120) and I use this
code: $var = secure_field($id); it will work (on the
What is secure_field()? Is this a function of yours?

The expression $id is a variable. Passing the variable to the
secure_field() function substitutes the value of $id, not the string '$id'.
What is the value of $id? Presumably it contains the name of the request
parameter you're reading.
"recieve_page.php"). However if I use $secure_field($_POST['$id']) or
any POST/GET/REQUEST type option, it won't work.
In PHP, putting '$id' in quotes prevents the variable from being expanded.
So the expression is trying to find an entry in the _POST parameter array
whose name is literally '$id', not the value of the $id variable as in the
other example above.
2) I have a table, where I want a delete button at the end of each row .. . . <TD><a href='this_page.php?id=$id2'>Delete</a></TD>


You could make the href='this_page.php?id=$id2;action=delete' and then look
for the 'action' parameter in your php script. If the value is delete, then
delete the specified entry. If the value of the action parameter is not
delete, then it defaults to edit.

Regards,
Bill K.
Mar 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Rob Ristroph | last post by:
I have tried out PHP 5 for the first time (with assistance from this group -- thanks!). The people I was working with have a site that uses lots of php objects. They are having problems with...
8
by: Frnak McKenney | last post by:
Back when computer dinosaurs roamed the earth and the precursors to today's Internet were tiny flocks of TDMs living symbiotically with the silicon giants, tracking access to data processing...
3
by: Tom | last post by:
Hi friends I am new to remoting so this may sound silly. I don't understand remoting, I think its suppose to be client / server but why is it that you always need to attach somesort of...
0
by: WhatsPHP | last post by:
Hi I have this MySql and PHP installed on the same machine. The Mysql general query log was started with mysqld --log, to log all the queries that will be received by the mysql server. This does...
2
by: Jenny Zhang | last post by:
Hi, I am running OSDL-DBT3 test against PostgreSQL. I found performance difference between the runs even though the data and queries are the same. I tried to study this problem by getting...
5
by: Buddy | last post by:
Hello, I'm getting the following error when running a large SQL. I am using the SqlCommand and calling the ExecuteNonQuery with the CommandTimeout set to 0. Here is the example of the code ...
7
by: Joe Ross | last post by:
I've been working with Microsoft support for over 3 weeks now on an intermittent General Network Error we're seeing in our production environment between our ASP.NET application and SQL Server...
5
by: MP | last post by:
context: vb6 / ado / adox 2.8/ mdb file format / jet 4.0 provider (not using Access) trying to design first database I work for a very small company, detailing building 'components' There is...
10
by: Dixie | last post by:
I am appending some new fields to a table in vba and when I append a number field with is a byte, it does not inherit any format. I want it to be the General Number format, but it is blank. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.