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.





XML: Assign A Variable To TransactionArray.Transaction.TransactionID Where User ID =?


I want to be able to find and assign a PHP variable to the Transaction ID where the UserID is a specified user though Ebays XML API. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
How To Assign A Picture To A User
I am making a wannabe myspace for some friends to fart around with and was wondering if anyone could help me. I used a tutorial on uploading images but I need help assigning the uploaded image to the user that uploaded it.

View Replies !
Assign Value To Variable
Is there any way I can use a function to create a variable and assign
a value to it? I have a Perl script that returns some LDAP
information:

sn=Shore
givenname=Mike
logintime=20041008153445Z
logindisabled=FALSE

Instead of parsing this text and assigning the values, I was wondering
if a function exists where I can pass a variable name and a value, and
the variable would be created.

ie. somefunc("sn", "Shore")

Would create the variable $sn and assign the value "Shore" to it.

View Replies !
Assign To Variable
I am trying to take data from the database and assign it to a variable but i'm not sure how this is the code ive been trying

$sql = "SELECT Name FROM Names WHERE Name = 'Peter'";

while($row = @mysql_fetch_array($sql))
{
$var == $row['Name'];
}

View Replies !
Assign Javascript Variable To PHP Variable
i have select option on my website.When i choose select option  the value of selecet option which i get in the javascript want to assign to PHP variable .So that i can use that in the query.

View Replies !
How Can I Assign Output To A Variable?
I'm trying to send an email and would like to put the output of some of my script into the body of the email. Here's the part that needs to be executed: PHP Code:

View Replies !
Is It Possible To Assign A Whole Function Or Block To A Variable ???
Is it possible to assign a whole function or block to a variable ???

eg.
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<? if (db_num_rows($qid_p) == 0) { ?>
<li>No
<? } ?>
<? while ($prod = db_fetch_object($qid_p)) { ?>
<p><b><a href="product_details.php?id=<?=$prod->id?>"><? pv($prod->name) ?></a></b>
<br><? pv($prod->description) ?>
<br>$<? pv($prod->price) ?>
<br>[<a href="cart_add.php?id=<?=$prod->id?>">+ Add to Cart</a>]
<? } ?>

How to assign this code to a unique variable ???

View Replies !
Assign Function Output To Variable??
I've found some references to this topic at :
http://forums.devshed.com/showthrea...ion+to+variable
but it does not seem to be working for me.

here's a snippet...

<? PHP
function listPeople ($getArray)
{
foreach ( $getArray as $val )
{
echo "$val, ";
}
}

$foo = listPeople($splitDirector);
?>

The function works, and as you can see i'm simply trying to assign the output of the function to $foo. But instead, the output is written to the page where I assign it... like a print or echo statement, and the variable $foo is empty.

View Replies !
Ways To Assign A Value To A Session Variable.
I am wandering which way to assign a value to a session variable
exist. Which of the following examples will work.

Example #1:
session_start();
session_register("ex");
$ex = 2.0;
Example #2:
In first.php:
session_start();
session_register("ex");
In second.php:
$ex = 2.0;
Example #3:
In first.php:
session_start();...

View Replies !
Assign Variable From Database Field
Is there a way to assign a variable from a database field? I'm thinking along the lines of

$make = $row_rsList['make'];
$model = $row_rsList['model'];

then they'll switch out based on my SQL WHERE statement. This valid syntax?

View Replies !
Get A Page Title And Assign It To A Variable
Is there a command or a procedure to get a page title and assign it to a php variable.


View Replies !
Assign Userid To A Session Variable
When a user logs into my system, i assign their userid to a session variable

[php]
$_SESSION['userid'] = $myrow[0];
[php]

and then a user logs out, i do the following

[php]
$_SESSION['userid'] = ''
session_write_close();
[php]

so, when a user clicks on a link to a page they should only see when logged in, i do the following test

[php]
if (isset($_SESSION['userid']))
{
header('Location: members.php3');
}

[php]

but the logout does not seem to work for some reason? userid still seems to be set after running the logout script, any ideas? am i doing something silly?

View Replies !
Assign Dynamic Dropdown To Variable?
Is it possible to assign a dynamic dropdown script to a $variable? Code:

View Replies !
Assign A New Value To A Variable Passed From An Html Form
I'm trying to assign a new value to a variable passed from an html form to a php3 script. I'm using an if statement to evaluate variable 3 to see if it is equal to a specific string, if it is I'm reassigning variable 2 to be variable2+variable 3.

if ($question3!="select days")
{
$question2=$question2+$question3;
}

This is the statement. It keeps giving me a parse error and I can't seem to find the right documentation to show me how to combine two string variables.

View Replies !
How To Assign Data In A Table Field To A Variable
what exactly do i do to only retrieve information from a table and assign it to a variable? I don't want to manipulate the data in any way, just display it on the page.

View Replies !
Multi-Dimensional Arrays - Assign Variable
It's a simple question, but I'm just not
getting it.

I have two files:

<?php
$precinct = array (
array ( number=>2324,
centerlat=>-122.31705665588379,
centerlong=>47.710367959402525,
etc...

<?php
include ("precinctdata.php");
$filename = $_GET['id'];
$number = $precinct[filename-1][number];
etc...

I want to assign the value of "2324" to the variable $number. I've done
this with arrays that start with number=>1, 2, 3, etc., but not successfully
with specific values.

What am I missing?

View Replies !
Assign MySQL Function Result To PHP Variable
I know to use: mysql_fetch_row($result) to convert a row from a SQL query result set into an array for use with PHP. but in the case of SQL queries that return one value, such as calls to MySQL functions, is there another PHP mysql api function I should use.

For example, right now I use a "workaround" technique from PHPBuilder:
$result=mysql_query("SELECT COUNT(*) FROM tablename");
list($numrows)=mysql_fetch_row($result);

Rather than using this "workaround" code is there a way to simply assign the result of the MySQL function query to a variable.

$result=mysql_query("SELECT COUNT(*) FROM tablename");
$numrows=mysteryfunction($result);

View Replies !
Assign Variable To A Block Of Html Code
Is it possible to assign variable to a block of html code?
Something like this :

$myblokvar = "<table width="487" border="0" cellspacing="0" cellpadding="0">
<tr> <td><table width="487" border="0" cellspacing="0" cellpadding="0">
<tr> <td><img src="images/bartitle_login.gif " alt="Login" width="475"...

View Replies !
Count The Number Of Matches And Assign A Variable For Each One
I've been trying to work out a problem but I'm having no luck. I have
field in my table for area and I need to count the number of matches
and assign a variable for each one.. this is what I have but it doesn't
work.. any ideas? Code:

View Replies !
Assign Variable Name As Variable
I want to be able to create a foreach loop that will go through all the intended POST variables and then assign it as a standard variable.

For example, I want to have $username = $_POST['username'] without even knowing username exists in the context of the foreach loop. Code:

View Replies !
Transaction ID
i need to create a unique transaction id everytime somebody clicks checkout in my shop.. does anyone know how to do this? or have any links to ways of doing this?

View Replies !
PDO: Test For Transaction
I am using PDO for my MySQL database connection and actions.
I was wondering if it is possible to test if your are in a
transaction.
...
start transaction
...
call a function, can I test in this function if I am in the middle of
a transaction or not ?
...
end transaction
...

View Replies !
Handling Transaction
while updating my database (i am using mySQL) based on information provided by a user ..if due to some problems (say the server goes down .... electricity problems etc) half the entries have been stored and others aren't then i need to delete the entries how do i take care of that in php.

View Replies !
Interbase Transaction
Does anyone here knows how to do a transaction in Interbase using php? Does it works fine?

View Replies !
About Transaction(mysql)
I am new to PHP. All my codes of accessing MySQL in hand are from google. I got a queation about transaction. Following a sample from google, I have PHP Code:

$conn = mysql_pconnect(...);
  query('set autocommit=0;');
  query('start transaction;');
  foo1(); // some sqls updating table1
  foo2(); // some sqls updating table2
  foo3(); // some sqls updating table3
  if (ok)
    query('commit;');
  else query('rollback');

here, query() is an user-defined function for querying the database with the given sql. Before the stage of foo3, foo1 and foo2 has already change the table, and in foo3 a piece of code is added for confirmation. The code given above seems ok to me. However, I try to push the 'BACK' button on IE rather than pushing the 'confirmation' in foo3 and it makes mysql down ( I cannot access table1, table2 unless I restart mysqld). I try to repeat the experiment but nothing wrong again.

View Replies !
Mysql Transaction In Php
I want to perform a series action on the DB (insert, update, delete). I know that I can put the in a transaction so I can be sure that either al actions succeed or all failed.
How can I do that in php?

View Replies !
Transaction Myisam
how to use transaction in a MyISAM tables.

View Replies !
Transaction Support In PHP
I am trying to use database transactions in PHP. I know there is database transaction. support in MySQL but then I was wondering if there is any database transaction support in PHP (the same way we have in ASP).

View Replies !
Variable Handling - New User Problem
I am a new php learner. I have Fecora Core 1 with apache2 and php
installed on 1 pc and SuSE 9 with apache2 and php installed on a laptop.
I have the following problem with both:

I have a simple form: 1 field
I submit with action=get and the value is passed.
When the form refreshes the variable will NOT show with
echo $username;

However if I set $username to a value explicityly it will print it.
This suggests that the variable value is not being passed from form to
form. Otherwise php seems to be working.

View Replies !
User Authentication Using Session Variable
I have a login form (method:post) which works fine. But, when I add a session variable in order to keep the user logged in, the session does not work. I figure it out because i see no user data on the URL.

Changing the form method from post to get, seems to work (I mean userdata are on the URL), but in this case the form action (opening another page) is not performed.

View Replies !
Value In $_SESSION[user] Populate The Variable
I have text entered into MySQL, the text is something like: The user's name is $_SESSION[user]

I would like to select this data from the database and actually have the value in $_SESSION[user] populate the variable when it gets output to the screen.

So instead of outputing This user's name is $_SESSION[user], I would like it to output The user's name is treeleaf20.

View Replies !
Best Way To Update DB After Payment Transaction
im trying to make a script so users can make payments with paypal

how it works is they log in, go to the payment screen type in a number, then pay with paypal and their login user balance is updated with how much money they just paid on paypal.

the problem is i dont know how to go about updating the database.

the obvious way would be to use the paypal IPN thing which runs a script after the transaction on my server. exactly the kind of thing i need except that i also read that theres a chance that it could fail to go to the script: not good.

so what way would be best to handle the situation?

View Replies !
Doubt In Php-mysql Transaction
1.What are all the ways to optimize query?

2.Can we able to implement commit,rollback transaction in php,mysql
connection like oracle database? If yes how? can u able to give the guidelines
or sample scripts... If no.. Then there is no security for transaction. Is it?

3.Can I able to lock or unlock a record in a mysql table through php
interface? If can't it is also another drawback.

Normally I donot using commit,rollback transaction and lock concepts when I
program using php mysql. I believe it is not good. How do I make it good?

View Replies !
ODBC And Committing A Transaction?
I'm on a Windows hosting environment with GoDaddy. I normally prefer MySQL, but am stuck with MS Access. Anyhow, how do you one start and committ a transaction? I use odbc_connect and odbc_exec to run my queries, but do not understand the documentation for odbc_commit.

View Replies !
MySQL Transaction Support
I could not find any PHP functions that allow me to send multiple queries to MySQL inside a single transaction. So, are there any such functions available around??

Moreover, are there any classes available in PHP that provide an OO interface to communicate with mysql via PHP???

View Replies !
Credit Card Transaction
i wanna learn more about how to process credit card transaction. i under stand i have to create a form whereby the user selects credit card type n enter his/her card number, expiry date.etc. but how do i actually make connection to the merchant n so for?

View Replies !
Transaction/Union Issues
I'm trying to create a single transaction for modifying multiple tables with a single SQL call, however, SQL tells me that I have an invalid query: Code:

START TRANSACTION;
DELETE FROM a WHERE id=6523;
UPDATE table_relationships SET rel_asset_id=6524 WHERE rel_asset_id=6523;
DELETE FROM b WHERE rel_asset_id=6523;
DELETE FROM c WHERE rel_asset_id=6523;
DELETE FROM d WHERE rel_asset_id=6523;
DELETE FROM e WHERE rel_asset_id=6523;
DELETE FROM f WHERE rel_asset_id=6523;
DELETE FROM g WHERE rel_asset_id=6523;
DELETE FROM h WHERE rel_asset_id=6523;
DELETE FROM i WHERE rel_asset_id=6523;
UPDATE assets SET available=1 WHERE id=6524;
DELETE FROM pending WHERE id=4;
COMMIT;

I can execute each statement at a time, however when I try to put it into a transaction, or string them together with UNIONS, trouble ensues.

View Replies !
Financial Transaction Form
i am working on a multi-page purchase form which will collect eCheck or credit card info to accept user payments. I am PARANOID about security here and could would like to get the complete lowdown on where my security vulnerabilities might lie and how i might shore them up. My site will collect the credit card number but will not store it in any database for future use. Questions are inline. Code:

View Replies !
How To Get User Input For A Variable Without Using Forms Or Tables
I have created forms and taken user input from the forms into php variables. When validating the fields, if i find my conditions not satisfied on the php variable, i ignore the database connectivity and display error message and having the user to go back to the page and correct the error.

Is there a way i can correct the error without going back to the page, and getting the particular user input without having to create another form or table for input into the php variable.

View Replies !
Query User Info From A Session Variable
When a user logs in, a session variable is passed. The variable is the users ID. If the variable is passed successfully, they are logged in and I want to query the users information based on the session variable. Code:

View Replies !
Variable From Link In E-mail Is Cut Off Once User Logs In...
Every time I add an update to a user's account on my website, I have an auto e-mail sent out to the user. It is formatted with HTML and includes a hyperlink. This hyperlink will be in the form of http:/www.domainname.com/page.php?variable .

Once they click on it, they will be forced to login to the site since that page is restricted to clients only. Once they login in, I want them to be forwarded to that initial link that they clicked on. Instead, they are forwarded to http://www.domainname.com/page.php - The variable seems to get cut off. Can someone please assist me with keeping the url intact including the variable at the end?

Here is my code:

View Replies !
Storing And Viewing Transaction History
well i am about to aproach this because am building a app for my own business and i would like to view customer conact info and a there last 10 transactions with my business. i am not sure where to start on the add transaction history end. any suggestions would help.

View Replies !
Mysql Errors And Transaction Handling
(1) The "standard method" for handling errors when executing queries to
a mysql database, which is shown in most tutorials and books is:

mysql($query) or die("select/insert/update/delete query failed for
table_name");

Actually that is hardly what should be done in a good application.
Every other function has a means of returning a value, often true/false
or "0"/"1".
I feel it is best if we had something like :

$success = mysql($query);

if ( $sucess) {
//do something
} else {
//log error
//show customized error page
}

True, we can do the following:

mysql($query) or my_own_db_error_handler();

Is there anything that I dont know or any better idea?

Also, a basic question I have is - why we do have to do "or die()"? Is
it because we need to ensure that a moment a db script gives an error,
we have a query that has failed, so as damage control, we immediately
terminate the script, knowing that some queries have been executed and
others have not.
If this is the reason to use "or die()" is it not better to use
mysql_query("start transaction") and mysql_query("commit") or
"rollback" and put the commit at the end of the script and the rollback
in the above mentioned my_own_db_error_handler() ?
Is this a good way?

(2) Also, most big web hosts (shared hosting - I cannot afford to set
up a host myself or even dedicated hosting) do not have PHP5, which
has MySQLi which has much better MySQL functionality(bind variables
etc) . They have PHP 4.3.x. I am under the impression that for an
efficient PHP4 app you need to use the procedural style, since PHP4's
OO features are "slow and inefficient". Am i correct ?

View Replies !
Script To Calculate Correct Change From A Transaction.
The script would calculate the correct amount of change to return when performing a cash transaction. It must allow the user to enter two things:

(1) the cost of the transaction and
(2) the exact amount of money that the customer submits for the transaction.

You script will determine the largest amount of each denomination to return to the customer. Assume that the largest denomination a customer will use to pay is $100. You will need to calculate the correct amount of change to return using:

$50,
$20,
$10,
$5 and
$1 bills

as well as quarters, dimes, nickels and pennies. (For example, if the price of a transaction is $7.33 and the customer gives a $10 bill to the cashier,
the cashier should return $2.67.  This would be 2 one dollar bills, two quarters, 1 dime, 1 nickels and 2 pennies.

I was thinking about setting up 2 htlm pages. 1st one with two text boxes for input of:

1st HTML page:
1st box = totalprice
2nd box = totalcash

then the PHP code using a switch statement that would use the remainder to break down the dollar amount.

2nd html page:
Your change is:
values from the PHP code.

I think im heading in a right direction but I might need a little help. Do i need to use GET/POST method? Is switch statement ok? How and where would I declare all the values from $100 to pennies

View Replies !
Saving Data - Credit Card Transaction
Im doing a order.php whereby user insert their info. after a successful validation, the user will be brought to the payment.php for payment. after which, the credit card transaction will be process. if it is successful, the data from order.php and payment.php will be inserted into database. so i wanna noe how to save the data from order.php n bring it ova to payment.php.

View Replies !
How Redirect A User To Another Page And Send Some Variable With The Post Method?
I make a user registration. It contains two/more page. First page is for official purpose. User ID, password and some other official information is in first page and user basic information is in second page. If user enter an user id that already exist in database then a message show the same page to change his user id otherwise page is redirect to second page and send user id, and other variable that was in first page.   My Code:

View Replies !
Single Database Transaction Across A Multiple HTTP Requests?
Does PHP have a feature to associate Cookie sessions with a persistent
database connection that will allow a single transaction across
multiple HTTP requests?

Here is how I imagine my process: I have an series of interactive HTML
forms. The user begins a Cookie session. A database connection is
opened and a transaction is begun. After the user goes through any
number of pages where they update the database they finish on a page
where they may commit or rollback the transaction.

This is not possible by default. PHP database connections implicitly
perform a commit or a rollback at the end of a script.

In other words, when I go to a page with a valid Cookie session I want
to be able to retrieve the same database connection I opened
previously. I don't want an automatic commit to be performed at the end
of the PHP script.

I'm using PostgreSQL. I'm aware of the difference between pg_pconnect()
and pg_connect(), but as I understand it this only does connection
pooling. It does not guarantee that you will get the SAME database
connection. Nor does it allow for transactions across multiple HTTP
requests. Am I wrong? Will pg_pconnect() do what I want?

I've seen some third party services that maintain databases connections
and allows them to be retrieved keyed to a Cookie. For example,
SQLRelay (http://sqlrelay.sourceforge.net/index.html), but this seems a
bit immature.

View Replies !
Open Socket Connection And Send Multiple Transaction
how could i make a socket connection to a server and transact multiple records like upto 10 records per second? and how am i going to know the result to the post if it is granted or not?

View Replies !
Apayment Processing Providers For Low Cost Per Transaction Processed
I have a site that needs to perform about 50-100 transactions per day of $1-$2USD. does anyone know what the best provider would be for such a payment processing system.

It is low per transaction so it would need to be one that did not charge a fixed fee or a high percentage at low prices. Paypal is still too high for me so I wouldnt use that. Any suggestions?

View Replies !
MDB2 (PEAR) Transaction Isolation Level Options
I'm curious about the implications of the WAIT and NO WAIT as well as READ ONLY and READ WRITE options when setting transaction isolation level as I've not been able to find a specification for what it does.

I've only seen it presented as follows: PHP Code:

$options = array('wait' => 'WAIT', 'rw' => 'READ WRITE');
$options = array('wait' => 'NO WAIT', 'rw' => 'READ ONLY');

$mdb2->setTransactionIsolation($isolation_level, $options);

View Replies !
How To Select A Transaction Of An Array And Check It On Regular Basis
I know that this is maybe a bit complicated but I thought I could take a chance and see if someone had time to read it trough. I need help with the whole script but the main thing is How to select just one transaction of all transactions ebay is returning (see the code sample, in the end of it).

I'm working on a script that will be able to "GetFeedback" to see if a user has left positive feedback and then "LeaveFeedback" positive if the feedback left was positive. Everything is built on XML, here is the functions described at ebay; Code:

View Replies !
Create A Simple Transaction Handling System Where Users Pay Eachother Via Points Of A Sort.
this might better be suited for the MySQL newsgroup, but I
figured I'ld post here and see if anyone can help me.

I'm trying to create a simple transaction handling system where users
pay eachother via points of a sort.
I have a table where each transaction is stored, in a single row.
It looks like this

transid,from_user,from_amount,to_user,to_amount

Given the above, I just want a simple single SQL statement that can
return a full balance.
Now originally I did this in PHP by querying the DB with the following.

$query[0] = "SELECT SUM(to_amount) WHERE to_user = '$user->uid'";
$query[1] = "SELECT SUM(from_amount) WHERE from_user = '$user->uid'";
$deposits = mysql_result(mysql_query($query[0]);
$withdrawls = mysql_result(mysql_query($query[1]);
$balance = $deopsits - $withdrawls;

This works great, so I populated the DB with over 100,000 records and
now page loads take 75-80 seconds for the total balance sheet page (I
just loop through each user, and there are 100 users), and upwards of
10 seconds on a single user query.

After analyzing the code in the profiler (I'm using Zend), I found the
largest optimization I could make would be to cut out the 2 queries
variable assignment and simple math (basically all of the code above),
and move it into a single SQL statement that does all the math.

This SHOULD be elementary, but unfortunately, MySQL doesn't like my
solution, and searching everywhere I could, I can't seem to find where
anything similar has every been tried. But come on, I know I can't be
the first person in history with a similar need for a query like this.

Here is the most elegant solution I could come up with, in all it's raw
SQL glory.

SELECT SUM(to_amount - from_amount) as balance FROM
((SELECT from_amount as withdrawls FROM transactions WHERE from_user =
&#391;')
(SELECT to_amount as deposits FROM transactions WHERE to_user = &#391;'));

Sadly, even though by every measure I can find it SHOULD work, it just
doesn't.
I keep getting

#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 '(SELECT to_amount as deposits FROM transactions WHERE to_user =
&#391;'))' at line 3

View Replies !
Cannot Re-assign $this ...
I'm one more guy having the cannot re-assign $this problem.

someone left a php4 file here containing the lines

|function linkbar()
|{
|if(func_num_args() == 1)
|{

|$this = func_get_arg(0);
|return;
}
...
|}

inside a php4 class definition. func_get_arg(0) in this case delivers
an object - working fine in php4. I struggled a bit with the &
referencing (while not really understanding it and the problem) but
gave up. how must I modify the code to get it to work in php5?

View Replies !

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