Jump to content

V(oice)XML/MySQL/PHP, how to fetch out variables ?


Lind/swe

Recommended Posts

Hi!  ;D

 

I have a question (hopefully someone in here have worked with VXML and server scripts with a back-end database).

How do i write the php code that fetch out the variables i am storing in mysql with vxml tags ?

 

I have tried (using bevocal cafe) the code below, but without any luck(i am sure there is something with the echo/print statment)

 

<?php

header("Content-type: application/voicexml+xml");

$connection = mysql_connect("http://**my_IP****", "***", "****");

mysql_select_db("test",$connect);

$result = mysql_query("SELECT * FROM students");

?>

<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN"

  "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">

 

  <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">

<form>

<block>

<?php

while ($row = mysql_fetch_array($result)) {

       

print "your names is" . $row['Name'];

?>

}

</block>

</form>

</vxml>

<?php

mysql_close($connection);

?>

 

any advice ?

 

Thanks in advance and Take care

/L

$connection = mysql_connect("http://**my_IP****", "***", "****");
mysql_select_db("test",$connect);

 

should be

 

$connection = mysql_connect("http://**my_IP****", "***", "****");
mysql_select_db("test",$connection);

 

If that's not the answer, post the error you're getting.

Michael,

 

Thanks for taking your time  ;)

Yes, you are right, i have changed it now.

 

But there is something wrong when trying to remote mysql(wamp) using my ip adress instead of localhost.

I dont know why becuase i have created a new user account that can access from any host, disabled the firewall but no luck. I keep getting the

 

Can't connect to MySQL server on 'http' (10060)

when putting ip insted of localhost.

 

ever seen that error before ?

 

..and what happend to my name, i thought i join the board as Linda/swe but apparently i am only Lind today  :D oh well mabey i am not that good debugger after all.....

Sorry, I'm not too versed with mysql (besides basic data manipulation).  But I'd start by double checking that the user has access from any ip.  Maybe try to connect to mysql from a different computer (ip) via the command line to see if you can get in.

 

Hope someone with more mysql knowledge comes by to help you out

Mike

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.