|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
php ,wap and mysql integration
i have a mobile logo site.
i have a image mysql database.all the images are 128x128 jpeg images. the fields are id(auto increment) image(longblob) info(varchar) the way i connect to the db is <? $db = mysql_connect("yourusername", "yourpassword"); mysql_select_db("yourdatabasename",$db); ?> say that i have 10 jpeg images in my database. i need to retrieve one row from the dbase based on the id. i use a form to get the id from the user. <?php // send the wml headers header("Content-type: text/vnd.wap.wml"); echo "<?xml version="1.0"?>"; echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"" . " "http://www.wapforum.org/DTD/wml_1.1.xml">"; ?> <wml> <card id="card1" title="Wap download" > <do type="accept" label="Submit"> <go href="getdata.php3"/> <postfield name="id" value="$id" method="post"/> </do> <p> <input title="Id" name="id"/> </p> </card> </wml> getdata.php3 is as follows <?php if($id) { @MYSQL_CONNECT("localhost","user","pass"); @mysql_select_db("db"); $query = "select bin_data,filetype,description from binary_data where id=$id"; $result = @MYSQL_QUERY($query); $data = @MYSQL_RESULT($result,0,"bin_data"); $type = @MYSQL_RESULT($result,0,"filetype"); $titl = @MYSQL_RESULT($result,0,"description"); Header( "Content-type: $type"); echo $data; echo $titl; }; ?> but this is not working on a Xhtml compatible phone but it must work. i get unknown file type. check out www.jhonny.org/wap and www.wap.lasyk.net on a wap browser to see what i mean |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Mobile Programming > php ,wap and mysql integration |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|