Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreMobile Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 8th, 2004, 03:07 AM
varunkrish varunkrish is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 13 varunkrish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreMobile Programming > php ,wap and mysql integration


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT