Jump to content

smartguyin

Members
  • Posts

    61
  • Joined

  • Last visited

    Never

Everything posted by smartguyin

  1. Sorry i forgot to post the error.. Insert Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, in_name, in_address, phone, email, mobile1, mobile2, date, comment) VALUE' at line 1
  2. I have a Form on registration.html through which i trying to get data in mysql through the below php script but there is and mysql syntax error please help me with the below code. <?php $conn = mysql_connect("localhost", "onlinewe_meghraj", "password123") or die(mysql_error()); $db = mysql_select_db("onlinewe_college") or die(mysql_error()); $name1 = $_POST['name1']; $name2 = $_POST['name2']; $year = $_POST['year']; $department = $_POST['deparment']; $group = $_POST['group']; $in_name = $_POST['in_name']; $in_address = $_POST['in_address']; $phone = $_POST['phone']; $email = $_POST['email']; $mobile1 = $_POST['mobile1']; $mobile12 = $_POST['mobile2']; $comment = $_POST['comment']; $result=mysql_query("INSERT INTO register (name1, name2, year, department, group, in_name, in_address, phone, email, mobile1, mobile2, date, comment) VALUES ('$name1', '$name2', '$year', '$department', '$group', '$in_name', '$in_address', '$phone', '$email', '$mobile1', '$mobile2', '".date("Y-m-d h:i:s")."', '$comment')") or die("Insert Error: ".mysql_error()); echo "REGISTRATION DONE"; ?> Please reply. Thank you.
  3. Jesi i am not yelling i mistakely kept the caps on..... if i hurt you i am sorry for those mistakely keeping Caps On..... okay thanks for even trying.... thank you all except jesi... babes i was not Yelling on anyone... and why should i ????????/
  4. YES I DON'T HAVE FUNCTION ON THAT ITS ON OTHER PAGE LIKE BODY.PHP WHICH COMES AFTER HEADER.PHP THE ABOVE CODE IS IN HEADER.PHP SOO  IT DOESN'T HAVE THT FUNCTION ON SAME PAGE
  5. but even if (!function_exists('setup_page')) { echo "NO TITLE"; } is not working .... its not showing NO TITLE...
  6. jesi i know its a poor design i am learning it and this is my first project...  and will get it done correctly next time.. but for now please tell me how can i do tht
  7. can u please explain how to do it coz i have never used tht function before or know how to apply it... please explain
  8. i think error is in this [b]mysql_select_db("krankdcontacts, $db);[/b] while selecting db you forgot [b]"[/b] correct it to [b]mysql_select_db("krankdcontacts", $db);[/b]
  9. still i am not getting it..... i just wanna know if the page is not having [b]setup_page($title)[/b] fucntion then i wanna echo other thing as i explained above
  10. CAN I DO SOME THING LIKE THIS... if (!function setup_page($title)) { echo "NO TITLE"; } i know this code is worng help me with this to use if else statement
  11. CAN I DO SOME THING LIKE THIS... if (!function setup_page($title)) { echo "NO TITLE"; } i know this code is worng help me with this to use if else statement
  12. No NOT yet... thanks for your help.. ok tell me if no function is set for title like setup_page("Search Page");  then how can i echo NO TITLE
  13. no still not getting it [b]NO TITLE[/b] the variable is coming from body.php which is place in index.php after header.php  Soo if some of the pages which the variable is not set...  then i wanna echo [b]NO TITLE[/b] Thanks for helping but still i am not getting it
  14. please explain me i am still not able to use the ELSE IF STATEMENT....  sooo if there is no $title variable sent by another script then it should echo the other thing.. please help
  15. I am using a function  in my script like this one ... function setup_page ($title) { echo "<html> <head> <title>My Database $title</title>"; } I want to echo the below if there is no function variable used.. in above func... [b]setup_page ($title)[/b] comes from another page soo if there is no [b]setup_page ($title)[/b] my scirpt should echo the below [b] echo  "<html> <head> <title>NO TITLE</title>";[/b]
  16. i want to convert the first letter in variable in caps. suppose... $var = "abc"; i want to display it like  >>>>  [b]Abc[/b] And if i want to convert all characters in caps then wht should i do...
  17. I had solved my prblem by using this below i used function to get wht i wanted.... in header.php i used function setup_page ($title) { <html> <head> <title>$title</title> </head> } In footer.php setup_page("$row['title']") And in this was i was able to trf the content i want from footer to header.php
  18. Can i use funtions to do this thing ???? Can functione help me to get things from footer.php and use it in header.php I know its possible by function can any one explain me the logic which i can use.
  19. In my index.php i had included header.php and footer.php My index.php page [code]<? include "header.php //////// BODY include "footer.php ?>[/code] My header.php page [code]<? echo "<html> <head> <title>$titlename</title> <head> <body>"; ?>[/code] My footer.php page [code] <? ///// the variable $title i got it from database here $row['title'] = $titlename; ///// I WANT TO USE THIS $titlename IN HEADER.PHP echo "</body> </html>"; ?> [/code] Now in header file there is title tag.... i want to use one $var variable from footer.php file but i am not able to do it coz footer.php file is included after header.php...... sooo i cannot get the Title in header.php file to be displayed........ footer.php file is the main body which interacts with mysql database and works.... sooo i suppose there is product title stated as a variable in footer.php i want to use tht variable in header.php ......... please tell me how to do it...........
  20. okay cool got it..... Thanks........
  21. columns in every table are like .... id, area, price, username, address
  22. No these categories are in different tables but when the user post in any of the category username is saved in the every table which he has posted.... like there are 3 tables for Flat  -  fl Land - ld Rent - re sooo i want to call in all the tables where username is "$username"
  23. Can i fetch data from 2 or more tables in one single query... I have about 3 to 4 categories and the use having content in all the 3 to 4 catogires for which i created different different table... Please see my Code here [code]<p><center><h1>My Property Details</h1></center></p> <br> <?php echo "<h3>FLATS ADDED BY YOU</h3>"; $query  = "SELECT * FROM fl WHERE fl_userid = '".$_SESSION['user_logged']."'";        $result = mysql_query($query) or die("Error: " . mysql_error()); echo "<table border=\"1\">\n"; while ($row = mysql_fetch_assoc($result)) { echo "<tr>\n"; foreach($row as $value) { echo "<td>"; echo $value; echo "</td>\n"; } echo "</tr>\n"; } echo "</table><br><hr>\n"; //////////////////////////////////// echo "<h3>LAND ADDED BY YOU</h3>"; $query  = "SELECT * FROM ld WHERE ld_userid = '".$_SESSION['user_logged']."'";        $result = mysql_query($query) or die("Error: " . mysql_error()); echo "<table border=\"1\">\n"; while ($row = mysql_fetch_assoc($result)) { echo "<tr>\n"; foreach($row as $value) { echo "<td>"; echo $value; echo "</td>\n"; } echo "</tr>\n"; } echo "</table><br><hr>\n"; ////////////////////////////////////// echo "<h3>RENT PROPERTIES ADDED BY YOU</h3>"; $query  = "SELECT * FROM re WHERE re_userid = '".$_SESSION['user_logged']."'";        $result = mysql_query($query) or die("Error: " . mysql_error()); echo "<table border=\"1\">\n"; while ($row = mysql_fetch_assoc($result)) { echo "<tr>\n"; foreach($row as $value) { echo "<td>"; echo $value; echo "</td>\n"; } echo "</tr>\n"; } echo "</table><br><hr>\n"; ?> /////////////////////////////////////////////////////////////////[/code] I this i have 3 categories -- Flat, Land and Rent... I want to display all the listing in all the tables i.e. of Flat Land and Rent..... is tht possible in single Query Please help me........
×
×
  • 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.