Re: [flexcoders] Need Help Getting A Value Into My App Via Flex And Php

2010-04-24 Thread Haykel BEN JEMIA
Probably this has to do with the fact that you are setting the data type to
xml but not outputting valid xml. Try with something like:

echo responsenextIncrement$next_increment/nextIncrement/response;

Haykel Ben Jemia

Allmas
Web  RIA Development
http://www.allmas-tn.com




On Fri, Apr 23, 2010 at 10:49 PM, James garymoorcroft_...@yahoo.co.ukwrote:



 I know this may not be the place to ask about php but I thought people may
 have came across a similar problem. Basically the data for my app is stored
 in a mysql database table and what I need to do is get the auto increment
 value of this table into my app via a http request. I'm trying to make a php
 file which gets this value and outputs this value as xml but I am awful at
 creating php to do such things and just get constant errors. Can anyone take
 a look at this and help me out to tweak it so it does what I want please?
 The table in question is called links and the field/row/column in the table
 I'm after is called linkid. It's the next autoincrement value of that row
 outputted as xml is what I want. Here's the php so far:-

 ?php

 header(Content-type: text/xml);

 $host = ;
 $user = ;
 $pass = ;
 $database = ;

 $linkID = mysql_connect($host, $user, $pass) or die(Could not connect to
 host.);
 mysql_select_db($database, $linkID) or die(Could not find database.);

 $tablename = links;
 $next_increment = 0;
 $qShowStatus = SHOW TABLE STATUS LIKE '$tablename';
 $qShowStatusResult = mysql_query($qShowStatus) or die ( Query failed:  .
 mysql_error() . br/ . $qShowStatus );

 $row = mysql_fetch_assoc($qShowStatusResult);
 $next_increment = $row['Auto_increment'];

 echo next increment number: [$next_increment];

 ?

  



[flexcoders] Need Help Getting A Value Into My App Via Flex And Php

2010-04-23 Thread James
I know this may not be the place to ask about php but I thought people may have 
came across a similar problem. Basically the data for my app is stored in a 
mysql database table and what I need to do is get the auto increment value of 
this table into my app via a http request. I'm trying to make a php file which 
gets this value and outputs this value as xml but I am awful at creating php to 
do such things and just get constant errors. Can anyone take a look at this and 
help me out to tweak it so it does what I want please? The table in question is 
called links and the field/row/column in the table I'm after is called linkid. 
It's the next autoincrement value of that row outputted as xml is what I want. 
Here's the php so far:-

?php 

header(Content-type: text/xml); 

$host = ; 
$user = ; 
$pass = ; 
$database = ; 

$linkID = mysql_connect($host, $user, $pass) or die(Could not connect to 
host.); 
mysql_select_db($database, $linkID) or die(Could not find database.); 

$tablename  = links;
$next_increment = 0;
$qShowStatus= SHOW TABLE STATUS LIKE '$tablename';
$qShowStatusResult  = mysql_query($qShowStatus) or die ( Query failed:  . 
mysql_error() . br/ . $qShowStatus );

$row = mysql_fetch_assoc($qShowStatusResult);
$next_increment = $row['Auto_increment'];

echo next increment number: [$next_increment]; 

?