Lind/swe Posted April 20, 2007 Share Posted April 20, 2007 Hi! 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 Link to comment https://forums.phpfreaks.com/topic/47864-voicexmlmysqlphp-how-to-fetch-out-variables/ Share on other sites More sharing options...
Michael Lasky Posted April 20, 2007 Share Posted April 20, 2007 $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. Link to comment https://forums.phpfreaks.com/topic/47864-voicexmlmysqlphp-how-to-fetch-out-variables/#findComment-233980 Share on other sites More sharing options...
Lind/swe Posted April 20, 2007 Author Share Posted April 20, 2007 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 oh well mabey i am not that good debugger after all..... Link to comment https://forums.phpfreaks.com/topic/47864-voicexmlmysqlphp-how-to-fetch-out-variables/#findComment-234079 Share on other sites More sharing options...
Michael Lasky Posted April 20, 2007 Share Posted April 20, 2007 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 Link to comment https://forums.phpfreaks.com/topic/47864-voicexmlmysqlphp-how-to-fetch-out-variables/#findComment-234086 Share on other sites More sharing options...
Lind/swe Posted April 20, 2007 Author Share Posted April 20, 2007 good news!! it works!! now it was my fault setting the permissions on the new user account. the $connection thing was the main problem so you are the hero today Michael! thanks and take care!! /Linda Link to comment https://forums.phpfreaks.com/topic/47864-voicexmlmysqlphp-how-to-fetch-out-variables/#findComment-234092 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.