Jump to content

Spraban9

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by Spraban9

  1. same database like the localhost have but in 000webhost phpmyadmin display this error to this query
  2. this coding is working in localhost <?php include("include/connection.php"); $profile= mysql_query("SELECT count( user )FROM (SELECT user FROM computerrepair UNION ALL SELECT user FROM computersale UNION ALL SELECT user FROM hospital UNION ALL SELECT user FROM hotel UNION ALL SELECT user FROM house UNION ALL SELECT user FROM land UNION ALL SELECT user FROM mobile UNION ALL SELECT user FROM theater UNION ALL SELECT user FROM upload UNION ALL SELECT user FROM vechicle) AS a WHERE user = '$login_session'",$conn); $menus=mysql_fetch_assoc($profile); $noof=$menus['count( user )']; ?> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a8326388/public_html/profile.php on line 59 $menus=mysql_fetch_assoc($profile); is in line 59
  3. create view alltable as SELECT cr.city,cr.address,cr.description,cr.contact,cr.postdate,cs.city,cs.address,cs.description,cs.contact,cs.postdate,la.city,la.address,la.description,la.contact,la.postdate,ho.city,ho.address,ho.description,ho.contact,ho.postdate from computerrepair as cr,computersale as cs, land as la,house as ho where cr.postdate =cs.postdate and cs.postdate=la.postdate and la.postdate=ho.postdate and cr.postdate='2013-03-26' hi friends i create view for get data in order to postdate but this coding show below error. #1060 - Duplicate column name 'city' how to solve this problem friends
  4. create view alltable as(SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from computerrepair union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from computersale union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from land union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from house union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from vechicle union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from mobile)order by postdate this also not working
  5. SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`(SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from computerrepair union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from computersale union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from land union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from house union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from vechicle union SELECT `title`,`city`,`address`,`description`,`contact`,`postdate`from mobile)A order by postdate hi friends this coding is used to retrievee data from all table in descending order of posedate but it is not working
  6. <?php include("include/connection.php"); $profile= mysql_query("SELECT count( user )FROM (SELECT user FROM computerrepair UNION ALL SELECT user FROM computersale UNION ALL SELECT user FROM hospital UNION ALL SELECT user FROM hotel UNION ALL SELECT user FROM house UNION ALL SELECT user FROM land UNION ALL SELECT user FROM mobile UNION ALL SELECT user FROM theater UNION ALL SELECT user FROM upload UNION ALL SELECT user FROM vechicle) AS a WHERE user = '$login_session'"); $menus=mysql_fetch_array($profile); $noof=$menus['count( user )']; ?> this coding is used to count no of post of user. but it is working on localhost . but i host in online i get this error "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a8326388/public_html/profile.php on line 59" line 59 have this coding"$menus=mysql_fetch_array($profile);"
  7. hi friends I am trying to design a user profile page layout . have tried several times to give it a look like how I want it to be but I failed. in this website user can can upload many ads . every ads having suppurate table. how to create user profile and edit function , plz help me, i'm struggle to complete my finial project friends.
  8. <?php if(isset($_POST['update'])){ $comf = $_POST['comf']; include("include/connection.php"); if (!$conn) { die('Could not connect: ' . mysql_error()); } mysql_select_db($database , $conn) or die (mysql_error()); $que1="update customer set active = 1 where randomno = '$comf' " ; $retval = mysql_query( $que1, $conn ); if(! $retval ) { die('Could not update data: ' . mysql_error()); } echo "Updated data successfully\n"; mysql_close($conn); } else { ?> <span style="float:right">Welcome to Addfreeads upload site <?php echo $name ?> </span> <label id="dis"> <h3><?php echo $saved?> </h3></label><br> <form name="frmconfor" id="frmconfor" method="post" action="<?php $_PHP_SELF ?>"> <h2> Enter your Verfication code here</h2> <table width="536" height="265" id="font" > <tr> <td height="62" class="style9"><label>Conformation Code</label></td> <td><input required name="comf" type="text" value="" /></td> </tr> <tr> <td height="118" colspan="2"> <div align="center"> <input name="update" type="submit" id="update" value="Update"> </div></td> </tr> </table> </form> <?php } ?> </center> i change coding like this but update not working
  9. hi friends how retrieve data in current data update to retrieve from the database from all table in one page how is possible i know to retrieve data from one table. only plz guide me
  10. hi this coding to showing error but update not working <?php if(isset($_POST['update'])){ $comf = $_POST['comf']; include("include/connection.php"); if (!$conn) { die('Could not connect: ' . mysql_error()); } mysql_select_db($database , $conn) or die (mysql_error()); $que1="update customer set active = 1 where randomno ='$comf' " ; mysql_select_db('vas'); $retval = mysql_query( $que1, $conn ); if(! $retval ) { die('Could not update data: ' . mysql_error()); } echo "Updated data successfully\n"; mysql_close($conn); } else { ?> <label id="dis"> <h3><?php echo $saved?> </h3></label><br> <form name="frmconfor" id="frmconfor" method="post" action="<?php $_PHP_SELF ?>"> <table width="536" height="265" id="font" > <tr> <td height="62" class="style9"><label>Conformation Code</label></td> <td><input required name="comf" type="text" value="" /></td> </tr> <tr> <td height="118" colspan="2"> <div align="center"> <input name="update" type="submit" id="update" value="Update"> </div></td> </tr> </table> </form> <?php } ?> </center> it show the "update successfuly "message but no change in database
  11. hi friends i have the error in update coding plz help me to solve this problem <?php if($_POST['comf'] != ''){ /*$name = $_POST['name']; */ $comf = $_POST['comf']; include("include/connection.php"); if (!$conn) { die('Could not connect: ' . mysql_error()); } mysql_select_db($database , $conn) or die (mysql_error()); /* $result = "UPDATE customer SET active = 1 WHERE randomno='$comf' "; $que=mysqli_query($r)or die(mysql_error()); $que=mysql_query("select active from customer where user='$name'"); if($que) {*/ $que1=mysql_query($conn,"UPDATE customer SET active = 1 WHERE randomno ='$comf' ") ; if (!$que1 ){ die("Database query failed: ". mysql_error()); } else { /*$saved= "Error in conformation code please retype"; */ $saved= "Thank you to Activate Your Account "; } } ?> <label id="dis"> <h3><?php echo $saved?> </h3></label><br> <form name="frmconfor" id="frmconfor" method="post" action="comformation.php"> <table width="536" height="265" id="font" > <!-- <tr> <td height="62" class="style9"><label>UserName</label></td> <td><input required name="name" type="text" value="" /></td> </tr>--> <tr> <td height="62" class="style9"><label>Conformation Code</label></td> <td><input required name="comf" type="text" value="" /></td> </tr> <tr> <td height="118" colspan="2"> <div align="center"> <input name="submit" type="submit" value="submit"/> </div></td> </tr> </table> </form></center>
  12. hi friends this coding is not working <center> <?php if($_POST['name'] != '' && $_POST['comf'] != ''){ $name=$_POST['name']; $comf = $_POST['comf']; include("include/connection.php"); if (!$conn) { die('Could not connect: ' . mysql_error()); } mysql_select_db($database , $conn) or die (mysql_error()); $result = mysql_query("select user,randomno from customer where user = '$name' and randomno='$comf'"); if(mysql_num_rows($result)>0) { mysqli_query("UPDATE customer SET active = 1 WHERE user='$name' ") or die(mysql_error()); } } ?> <form name="frmconfor" id="frmconfor" method="post" action="comformation.php"> <table width="536" height="265" id="font" > <tr> <td height="62" class="style9"><label>UserName</label></td> <td><input required name="name" type="text" value="" /></td> </tr> <tr> <td height="62" class="style9"><label>Conformation Code</label></td> <td><input required name="comf" type="text" value="" /></td> </tr> <tr> <td height="118" colspan="2"> <div align="center"> <input name="submit" type="submit" value="submit"/> </div></td> </tr> </table> </form></center>
  13. it working answer is <?php // May 25, 2010 include("include/connection.php"); if(isset($_FILES['file']) && $_FILES['file']['size'] > 0) { // Temporary file name stored on the server $name1 = $_POST['name1']; $type = $_POST['type']; $model = $_POST['model']; $processor = $_POST['processor']; $memory = $_POST['memory']; $hd_size = $_POST['hd_size']; $vga = $_POST['vga']; $monitor_type = $_POST['monitor_type']; $monitor_size = $_POST['monitor_size']; $os = $_POST['os']; $price = $_POST['price']; $title = $_POST['title']; $city = $_POST['city']; $address = $_POST['address']; $description = $_POST['description']; $contact = $_POST['contact']; $postdate = date("F j, Y"); $tmpName = $_FILES['file']['tmp_name']; // Read the file $fp = fopen($tmpName, 'r'); $data = fread($fp, filesize($tmpName)); $data = addslashes($data); fclose($fp); $result = mysql_query("INSERT INTO computersale (name ,type ,model,processor ,memory ,hd_size ,vga ,monitor_type ,monitor_size ,os ,price ,title ,city ,address ,description ,contact ,postdate,image) VALUES ('".$name1."','".$type."', '".$model."' , '".$processor."', '".$memory."', '".$hd_size."', '".$vga."', '".$monitor_type."', '".$monitor_size."', '".$os."', '".$price."', '".$title."', '".$city."','".$address."' , '".$description."','".$contact."','".$postdate."','$data' )",$conn); if($result){ $saved= " Enter the Verification code from your phone "; } else { $saved= "Cannot send Confirmation Verfication code to your contact number"; } }?> </label>
  14. hi friends this coding is field name are ok but if i press save button i get error like this"Database query failed: MySQL server has gone away" <?php // May 25, 2010 include("include/connection.php"); if (isset($_FILES['file']) && $_FILES['file']['size'] > 0) { // Temporary file name stored on the server $name1 = $_POST['name1']; $type = $_POST['type']; $model = $_POST['model']; $processor = $_POST['processor']; $memory = $_POST['memory']; $hd_size = $_POST['hd_size']; $vga = $_POST['vga']; $monitor_type = $_POST['monitor_type']; $monitor_size = $_POST['monitor_size']; $os = $_POST['os']; $price = $_POST['price']; $title = $_POST['title']; $city = $_POST['city']; $address = $_POST['address']; $description = $_POST['description']; $contact = $_POST['contact']; $postdate = date("F j, Y"); $tmpName = $_FILES['file']['tmp_name']; // Read the file $fp = fopen($tmpName, 'r'); $data = fread($fp, filesize($tmpName)); $data = addslashes($data); fclose($fp); $result = mysql_query("INSERT INTO computersale (name ,type ,model , processor ,memory ,hd_size ,vga ,monitor_type ,monitor_size ,os ,price ,title ,city ,address ,description ,contact ,postdate) VALUES ('$name1','$type', '$model' , '$processor', '$memory', '$hd_size', '$vga', '$monitor_type', '$monitor_size', '$os', '$price', '$title', '$city','$address' , '$description','$contact','$postdate','$data' )",$conn); if(!$result) { die("Database query failed: ". mysql_error()); } // Print results print "Thank you, your file has been uploaded."; } ?> </label> <form name="frmcompsa" method="post" enctype="multipart/form-data" action="compusaleup.php"> <div id="form"> <h2>Upload Computer Sales Ads </h2> <table width="537" height="485" id="font"; > <tr> <td width="126" height="35" id="font"><label class="style9"> Type</label></td> <td width="349"><input name="type" type="text" value="" width="250"/> </td> </tr> <tr> <td height="38" id="font"><label class="style9">Model</label></td> <td><input name="model" type="text" value="" /> <input name="name1" type="text" style="visibility:hidden" value="<?php echo $name ?>" /></td> </tr> <tr> <td height="34" id="font"><label class="style9">Processor</label></td> <td><input name="processor" type="text" value="" width="250"/></td> </tr> <tr> <td height="34" id="font"><label class="style9">Memory</label></td> <td> <input name="memory" type="text" value="" width="250"/> </td> </tr> <tr> <td height="44" id="font"><label class="style9">Hard disk</label></td> <td><input name="hd_size" type="text" value="" width="250"/></td> </tr> <tr> <td height="36" id="font"><label class="style9">Graphic Card</label></td> <td><input name="vga" type="text" value="" width="250" /> </td> </tr> <tr> <td height="38" id="font"><label class="style9">Monitor Type</label></td> <td><input name="monitor_type" type="text" value="" width="250"/></td> </tr> <tr> <td height="38" id="font"><label class="style9">Monitor Size</label></td> <td><input name="monitor_size" type="text" value="" width="250"/></td> </tr> <tr> <td height="36" id="font"><label class="style9">Operating System</label></td> <td><input name="os" type="text" value="" width="250" /></td> </tr> <tr> <td height="62"><label class="style9"> Price</label></td> <td><input name="price" type="text" value="" width="250" /></td> </tr> <tr> <td width="115" height="35"><label class="style9"> Ads title</label></td> <td width="407"><input name="title" type="text" width="250"value="" /></td> </tr> <tr> <td height="34"><label class="style9">Address</label></td> <td><textarea name="address" cols="40" rows="3"></textarea></td> </tr> <tr> <td height="36"><label class="style9">City</label></td> <td><input name="city" type="text" value="" width="250" /> <span style="font-size:13px" class="style10">SriLanka Only</span></td> </tr> <tr> <td height="62"><label class="style9">Description</label></td> <td><textarea name="description" cols="40" rows="3"></textarea></td> </tr> <tr> <td height="62"><label class="style9">Contact</label></td> <td><input name="contact" type="text" value="" width="250" /></td> </tr> <tr> <td height="38" class="style9" id="font">Upload Image</td> <td> <input type="file" name="file" id="file" /><br> </td> </tr> <tr> <td colspan="2"> <div align="center"> <input name="submit" type="submit" value="Submit"/> <input name="cancel" type="button" value="Cancel" /> </div></td> </tr> </table> </div></form>
  15. save button click ever means that i want the insert data before click the submit button i want to run this coding "INSERT INTO ozekimessageout (receiver,msg,status) VALUES ('".$contact."','".$randomno."','send')" after enter the contact no
  16. hi friends this is save coding but this not working if i click submit button not response all data show in address bar like this what is the solution for this problem localhost/cleanred/phoneadsup.php?make=nokia&model=800&name=praban&camera=3&inmemo=8+GB&exmemo=5+GB&display=LCD&os=window&price=20000&title=car+for+sale&address=kokuvil&city=colombo&description=ssssss&contact=0778459623&submit=Submit <?php if( $_POST['name'] != '' && $_POST['make'] != '' && $_POST['model'] != '' && $_POST['camera']!='' && $_POST['inmemo'] != '' && $_POST['exmemo'] != '' && $_POST['display'] != '' && $_POST['os']!='' && $_POST['price'] != '' && $_POST['title'] != '' && $_POST['city'] != '' && $_POST['address'] != '' &&$_POST['description'] != '' && $_POST['contact'] != '') { $name = $_POST['name']; $make = $_POST['make']; $model = $_POST['model']; $camera_mp = $_POST['camera']; $intermem = $_POST['inmemo']; $extermem = $_POST['exmemo']; $display = $_POST['display']; $os = $_POST['os']; $price = $_POST['price']; $title = $_POST['title']; $address = $_POST['address']; $city = $_POST['city']; $description = $_POST['description']; $contact = $_POST['contact']; $postdate = date("F j, Y"); echo "ok datat"; include("include/connection.php"); /* $sql=mysql_query("select name from customer where user='$ses_sql' "); */ $query = mysql_query("INSERT INTO mobile ( name ,make ,model ,camera_mp ,intermem ,extermem ,display ,os ,price ,title ,city ,address ,description ,contact ,postdate) VALUES ('".$name."','".$make."', '".$model."' ,'".$camera_mp."','".$intermem."','".$extermem."','".$display."','".$os."','".$price."','".$title."','".$city."','".$address."' ,'".$description."','".$contact."','".$postdate."' )"); echo $query; if($query){ $saved= " Enter the Verification code from your phone "; } else { $saved= "Cannot send Confirmation Verfication code to your contact number"; } }?> <label id="dis"> <?php echo $saved?> </label><br> <form name="frmphoneads" id="frmphoneads" action="phoneadsup.php"> <div id="form"> <h2>Upload Mobile phone Ads</h2> <table width="534" height="422" id="font"; > <tr> <td width="115" height="35"><label class="style9"> Make</label></td> <td width="407"><select name="make" width="250" > <option value="select" selected="selected">Select a type</option> <option value="nokia"> Nokia </option> <option value="sonye"> Sony Ericssion </option> <option value="Samsung"> Samsung </option> <option value="Motorola"> Motorola </option> <option value="lg"> LG </option> <option value="HTC"> HTC </option> <option value="Micromax"> Micromax </option> </select> </td> </tr> <tr> <td height="38"><label class="style9">Model</label></td> <td><input name="model" type="text" value="" /> <input name="name" type="text" value="" /></td> </tr> <tr> <td height="34"><label class="style9">Camera(MP)</label></td> <td><input name="camera" type="text" value="" width="150"/></td> </tr> <tr> <td height="34"><label class="style9">Internal Memory</label></td> <td><input name="inmemo" type="text" value="" width="150"/></td> </tr> <tr> <td height="34"><label class="style9">External Memory</label></td> <td><input name="exmemo" type="text" value="" width="150"/></td> </tr> <tr> <td height="34"><label class="style9">Display</label></td> <td><input name="display" type="text" value="" width="150"/></td> </tr> <tr> <td height="34"><label class="style9">Operating system</label></td> <td> <select name="os"> <option value="select" selected="selected" width="250">Select a o/s</option> <option value="window">Windows mobile</option> <option value="symbian">Symbian</option> <option value="android">Android</option> <option value="belle">Belle</option> </select></td> </tr> <tr> <td height="62"><label class="style9"> Price</label></td> <td><input name="price" type="text" value="" /></td> </tr> <tr> <td width="115" height="35"><label class="style9"> Ads title</label></td> <td width="407"><input name="title" type="text" value="" /></td> </tr> <tr> <td height="34"><label class="style9">Address</label></td> <td><input name="address" type="text" value="" /></td> </tr> <tr> <td height="36"><label class="style9">City</label></td> <td><input name="city" type="text" value="" width="250" /> <span style="font-size:13px" class="style10">Srilanka Only</span></td> </tr> <tr> <td height="62"><label class="style9">Description</label></td> <td><textarea name="description" cols="25" rows="5"></textarea></td> </tr> <tr> <td height="62"><label class="style9">Contact</label></td> <td><input name="contact" type="text" value="" width="250" /></td> </tr> <tr> <td height="118" colspan="2"> <input name="submit" type="submit" value="Submit"/> <input name="cancel" type="button" value="Cancel" /> </td> </tr> </table> </div></form>
  17. but it not working i try this coding if ( isset( $_REQUEST["action"] ) ) { $phone = htmlspecialchars($_POST['contact']); $que=mysql_query("INSERT INTO ozekimessageout (receiver,msg,status) VALUES ('".$phone."','".$randomString."','send')"); } plz help me i want save this message on buttin click <label>Contact No</label></span></td> <td><input required name="contact" type="text" value="" width="250" $pattern = "/^(\+94\s?7\d{3}|\s?\d{3}\s?\d{3}$/"; x-moz-errormessage="Mobile Phone is Required!"><input type="button" name="action" value="process" />
  18. hi guys, i create the form for registration i going to confirm via phone number "INSERT INTO ozekimessageout (receiver,msg,status) VALUES ('".$contact."','".$randomno."','send')" this query is working but i want to save this for button click event but already i have the save button for registration form i want one more button to run this query plz help me guys.
  19. <?php include("include/connection.php"); $catergory = $_POST['catergory']; $price= $_POST['price']; if(! $conn ) { die('Could not connect: ' . mysql_error()); } $sql = "SELECT * FROM upload where catergory ='$catergory'and price = '$price'"; mysql_select_db('vas'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not get data: ' . mysql_error()); } while($row = mysql_fetch_assoc($retval)) { echo "TITLE :{$row['title']} <br> ". "CATERGORY : {$row['catergory']} <br> ". "DESCRIBION : {$row['des']} <br> ". "--------------------------------<br>". "CONTACT NO:{$row['phone']} <br> ". "ADDRESS : {$row['address']} <br> ". "CITY : {$row['city']} <br> ". "--------------------------------<br>". "POST DATE :{$row['postdate']} <br> ". "PRICE : {$row['price']} <br> ". "{$row['image']} <br> ". "--------------------------------<br>"; } mysql_free_result($retval); echo "Fetched data successfully\n"; mysql_close($conn); ?> hi friends i get this output for this coding, image not display . "TITLE :van sale CATERGORY : mp DESCRIBION : asssssssssswwwww -------------------------------- CONTACT NO:778485956 ADDRESS : kokuvil west, kokuvil CITY : colombo -------------------------------- POST DATE :2013-03-12 PRICE : 0 JFIFC !"$"$C" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4% &'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?;FN)`GJ_03{}k<?bΊY2˹B)eTa zUx^H\Ku vGTRVZԭՑXБk>+H!뷗Uo.> VB.~ly'{42/QelmݠC}i\G,xPk|Q^%EN8sFp8 °NS]40izRb櫪Oe <EIyOIS9qϷ0W*eOzZ`Ǟ8C"M/H\78NAswpG2z '"
×
×
  • 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.