Jump to content

Search the Community

Showing results for tags 'php mysql'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 13 results

  1. Hi guys, please what am i doing wrong here? i have searched almost everywhere on the internet and found solutions similar to my own but they are not just working!! i am sorry if this question has been asked before. i'm not getting things right. the project is actually a very complex one. i have used many methods but all to no avail. Please help! I have two tables called "group_profile" and "group_members". The concept is that users have already created their groups. Then these groups have been stored into my database table. And now i want to retrieve the records from that table and display it on the "join_group.php" page so that that people can click to join those groups selected from the first table. Users can select multiple groups to join using checkboxes at a time. Therefore, when you join the group, the script will add both your data and the groups' to "group_members" table but if i select multiple groups and click on join button, it appears to add only the last group created in the "group_profile" table. Sometimes it will take me to the "processing-join-group.php" page and show me the script doesn't seem to work well. i'm sure there is something i'm doing wrong. Please here is my code so far: This is the "join_group.php" page below: <?php $other_following_account = mysqli_query($f->connectTo(), "SELECT * FROM group_profile"); if ($f->numR($other_following_account) > 0) { while($show_created_groups = $f->show_data($other_following_account)) { $select_member = $f->andFilterRecord("*", "hoollaa_group_members", "user_id", $_id, "group_id", $show_created_groups['id']); $chk_user_id = $f->show_data($select_member); $check_my_membership = $f->numR($select_member); if (!$check_my_membership) { if ($show_created_groups['user_id'] != $_id) { ?> <div class="inner-main-cont-left main-cont-right box-shadow" style="height: 370px; width: 250px;"> <?php if ( empty($show_created_groups['group_photo2']) ) { ?> <span class="container"> <span class="profile-avatar2"><?php echo substr($show_created_groups['group_name'], 0, 1);?></span> </span> <?php } else { ?> <img style="margin-bottom: -5px;" src="<?php echo $show_created_groups['group_photo2'];?>" /> <?php } ?> <div class="profile-content" style="padding: 10px 8px 10px 10px; height: 80px;"> <div class="main-cont-left-header-profile"><?php echo $show_created_groups['group_name'];?></div> <div class="clear-left"></div> <p style="word-wrap: break-word;"> <?php $d_string = $show_created_groups['group_description']; $new_str = (strlen($d_string) > 63) ? trim(substr($d_string, 0, 60))."..." : $d_string; echo $new_str; ?> </p> </div> <input name="admin_id[]" type="" value="<?php echo $show_created_groups['user_id']; ?>" /> <input name="group_name[]" type="" value="<?php echo $show_created_groups['group_name']; ?>" /> <input name="group_admin[]" type="" value="<?php echo $show_created_groups['group_admin']; ?>" /> <input name="group_id[]" type="" value="<?php echo $show_created_groups['id']; ?>" /> <input type="checkbox" name="join_data[]" value="<?php echo $show_created_groups['id']; ?>" id='c<?php echo $show_created_groups['id'];?>[]' class='chk-btn' /> <label style="padding: 10px; margin: 60px 0px 0px 178px;" for='c<?php echo $show_created_groups['id'];?>[]'>Join</label> </div> <?php } } } } ?> <div class="clear-left"></div> </div> <button class="skip-btn floating-nav-btn btn btn__trigger btn__trigger--views" name="join_btn" type="submit"> <i class="fa fa-caret-right" style="font-size: 32px;"></i> </button> </form> And here is the page that is receiving the data from "join_group.php" processing-join-group.php" page: <?php require_once "../set-header-dependencies.php"; /* $f->isUserLoggedIn_sess("auth", "../home.php"); $f->isUserLoggedOut_sess("auth", "../index.php"); */ $time_zone = date_default_timezone_set("Africa/Lagos"); $date_published = date("F d, Y"); $time_published = date("H:i:sa"); $time_stamp = time(); //Follow Selected group if (isset($_POST['join_btn'])) { if (isset($_POST['join_data'])) { $display_follow_data = $f->post_data('join_data'); if (is_array($display_follow_data)) { foreach ($display_follow_data as $key => $array_id) { $select_store = $f->andFilterRecord("*", "group_members", "user_id", $_id, "group_id", $array_id); $chk_user_id = $f->show_data($select_store); $select_from_main_store = $f->filterRecord("*", "group_profile", "user_id", $array_id); while($use_selected_product = $f->show_data($select_from_main_store)) { $admin_id = $use_selected_product['user_id']; $group_name = $use_selected_product['group_name']; $group_admin = $use_selected_product['group_admin']; $group_id = $use_selected_product['id']; if ($use_selected_product['id'] != $chk_user_id['group_id']) { $insert_follow_data = "INSERT INTO group_members(group_name,group_id,admin_id,group_admin,username,user_id,timestamp,date_published,time_published) VALUES ('$group_name','$group_id','$admin_id','$group_admin','$acc_username','$_id','$time_stamp','$date_published','$time_published')"; $f->cts($insert_follow_data); $_SESSION['follow_success'] = "<script>$('body').tpPopup({avatar: 'hoollaa-icons/Notifications.png',username: '',message: 'Group joined.',openOnClick: 'join-groups.php'});</script>"; $f->rdr("../home.php"); } else { $_SESSION['follow_error'] = "<script>$('body').tpPopup({avatar: 'hoollaa-icons/Notifications.png',username: '',message: 'Could not add you to.',openOnClick: 'join-groups.php'});</script>"; $f->rdr("../home.php"); } } } } else { $_SESSION['follow_error'] = "<script>$('body').tpPopup({avatar: 'hoollaa-icons/Notifications.png',username: '',message: 'Please select a group to join.',openOnClick: 'join-groups.php'});</script>"; $f->rdr("../home.php"); } } else { $_SESSION['follow_error'] = "<script>$('body').tpPopup({avatar: 'hoollaa-icons/Notifications.png',username: '',message: 'Please select a group to join.',openOnClick: 'join-groups.php'});</script>"; $f->rdr("../home.php"); } } ?>
  2. unexpected end of file

    Hallo, what might mean this message of error: "Parse error: syntax error, unexpected end of file in /home/pavlinan/public_html/mes.php on line 22" Here is the code: <?php$email = $_POST["meil"];$message = $_POST["area"];$ime= $_POST["ime"];echo "From: ".$_POST["ime"]."<br>";echo "Email: ".$_POST["meil"]."<br>";echo $_POST["area"]."<br>";// Create connection$con=mysql_connect("localhost","pavlinan_db","mishon24");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("pavlinan_backform");mysql_query("INSERT INTO `backform` (`name` , `email` , `text` )VALUES (`$ime`, `@email`, `$message`)`,$con);mysql_close($con);?>
  3. Update not Updating

    Here is one of the simplest routines I have written--right? No, wrong. The script takes a table, folds, spindles, and mutilates it, and writes the data back to the table. Here's the code: $Quest = "SELECT * FROM TOAWorkorders";$FindTechResult = mysql_query($Quest, $cxn) or die ('The easter bunny is watching you' . mysql_error());while ($row = mysql_fetch_array($FindTechResult)){ $IdNum = $row['IdNum']; $BBT = $row['BBT']; $BBTArray = explode("-", $BBT); $TechNum = $BBTArray["0"]; $Title = $BBTArray["2"]; $Name = explode(" ", $BBTArray['1']); $FirstName = $Name["0"]; $LastName = $Name["1"]; echo $TechNum . ' !! ' . $FirstName . ' !! ' . $LastName . ' !! ' . $Title . '<br>'; $Quest = "UPDATE TOAWorkorders SET TechNum = '$TechNum', FirstName = '$FirstName', LastName = '$LastName', Title = '$Title' WHERE IdNum = '$IdNum'";$result = mysql_query($Quest, $cxn) or die(mysql_error()); } The problem with the script is the `UPDATE` statement. The field is processed correctly, but the update only updates 2/3 of the table, leaving 33k of rows untouched. Any ideas??
  4. php mysql connection

    Hi, I'm just starting out with php and mysql.I've successfully created my database, tables, php connection file, and forms to update records so all in all good start.My connection.php looks like this: <?php$db_host = "localhost";$db_username = "dummy";$db_pass = "dummy1234";$db_use = "dummy";$con = mysql_connect("$db_host","$db_username","$db_pass");if (!$con) { die('Could not connect to mysql: ' . mysql_error()); } echo "Connected to mysql";?><br /><?phpmysql_select_db("$db_use", $con);echo "Connected to database: "."$db_use";?> I'm trying to create a form that submits variables e.g. $db_host = $_POST['host'];$db_username = $_POST['username']; $db_pass = $_POST['pass']; $db_use = $_POST['db']; so that the user can open different databases on different hosts.But when the php form is parsed I receive the undefined index error due to the variables not being set initially (I think!).Can anyone offer any advice?
  5. Free Online Schools for PHP

    I been searching and wanted to find a school that offers online courses in PHP for free Training. I 52 Years old and disabled. So I have a limited income. (It means I can't a ford to go back to school). I was wondering if any one knows of school or even some one who knows PHP or even CakePHP that could teach me. I just can't a ford $20.00 or $45.00 an hour to pay some one to teach me. Joe
  6. "Is there a way to submit create table query from a file to MySQL? I want to keep records of how my tables are created and later on be able to repeat creating them on a different PC."
  7. Using Nicedit

    After getting all the errors out from my pages. I have just one error left. I still get an error from the nicedit javascript. 'null' is null or not an object. on line 37 in nicEdit.js I did get the icons to show up on the page for the nicedit, And I can't see the words in the drop down boxes. Joe PS. Thanks justsomeguy for your help in fixing my pages.
  8. Folders, Files In The Web Root

    Go to http://toppersbbs.dtdns.net/mapnet/blog.php and click on the link after the 1st blog and click on Add Entry. The header loads in and I'm not gettings any errors. So why doesn't the images and back ground colors work. I guess the question is how can I use the same header files and so on in my web site and use sub folders and sub, sub folders with out the need to add all the files for my web site in the main root web folder. {root}-------mapnet-------blog/addentry.php this is the basic setup I have. I been putting mapnet together for the last 3 weeks. Any way it seems to me that it's not seeing the style sheet. So this mean how can I use the same header file in all my folders no matter where they are. In my config.php file. I define('WebRoot','/');define('LIB_PATH', 'sources/'); and theres some other ones I defined all so. Just to make finding paths and file easy. It was until I desided I didn't want every thing in the mapnet folder. Is there some thing I can do to setup an option that I can use the header file from any folder with out getting these kind of problems. Joe
  9. $Template->Assign_Vars(Array(

    I keep seeing info about this. I haven't been able to find the class for this. Does any one know where I can get the class for this. I need this to set options in my html pages. for links and crap like that. Joe
  10. I added an option to my web site. That users can update their profile. It adds all kinds of info like, User birth date, and crap like that. I wanted to add a drop down box where I have a text box. and let the users select the country they live in. I have a folder called country with a crap load of images for lots of countries. Well I'm trying to come up with an idea on just how to do this. The idea is when a user selects there country. The image show show on the page. and they can update their profile too. I guess the idea is to create a new file called, 'countries.php' and add an array to that called country. Then I would have to add them to the drop down box in some way... $country = array('USA' => 'us_en.gif',); Now the bigger problem I have is I have no way of knowing how to setup a drop down box with all the countries listed and the files names for each country. Any one have some thing all ready made up. With the images and the drop down box. Thanks AgainJoe
  11. Updating Records In Mysql

    Is there an easy way of updating a lot of records with using the same line over and over again. See I would have to repeat the same line over with new values and fields every time I wanted to update a lot of records. mysql_query("UPDATE profiles SET age='21' WHERE id='1'"); I would have to run that line above over and over again. Any one else have a better way of doing this. Joe
  12. well I been playing with this for 3 days and I still get the same error. I went over the code 20 + times and still can't find an error. can some one please help. I will have a comment where I get the error at. $mysql = new Mysql(); $mysql->connect(db_host, db_name, db_user, db_pass); // change this line here$query = "";if (!isset($_POST['maptype']) || empty($_POST['maptype'])) { $query = "SELECT * FROM ".db_prefix."maps WHERE category='".$c."'"; echo '<br />Your viewing all records for '.$category[$c].'<br />';} else if(isset($_POST['maptype'])) { //$maptype = ; $query = "SELECT * FROM '".db_prefix."maps' WHERE category='".$c."' AND maptype='".$_POST['maptype']."'"; echo '<br />Your viewing '.$maptypes[$_POST['maptype']].' for '.$category[$c].'<br />'; unset($_POST['maptype']); } else { echo 'Error getting maps.<br />'; exit();} //if ($mysql->GetRows($query) >= 1) { if ($mysql->GetRows($query) >= 1) { // I get the error here and while ($two = $mysql->fetchArray($query) >= 1) // I all so get the same error here too. //foreach (mysql_fetch_assoc($query) as $row) { $page = new page('sources/mapview.html'); $page->replace_tags(array( 'FILEID' => $row['id'], 'POSTEDBY' => $row['username'], 'TITLE' => $row['title'], 'DATEPOST' => $row['postdate'], 'FILENAME' => $row['filename'], 'MAPTYPE' => $row['maptype'], 'FILESIZE' => $row['filesize'], 'FILETYPE' => $row['filetype'], 'CATEGORY' => $row['category'], 'MAPREQUIRES' => $row['maprequire'], 'MAPIMAGE' => $row['image'], 'TOTALCOM' => '0', //DataManager->GetTotalCom($row['id']), 'TOTALDLS' => '0', //DataManager->Gettotaldls($row['id']), 'DESX' => '<textarea rows=3 cols=40>'.$row['desx'].'</textarea>', )); $page->output(); }} else { echo "Sorry, No maps here, Add some today<br />"; echo "<a href='upload.php?c=".$c."'>Add Map</a><br />";}
  13. ? It Does And Then It Doesn't

    I'm looking for some one who can VNC or use Teamviewer to help me with these PHP scripts. Ever since I desided to update it. I can't get every thing to work. I have an other set of PHP scripts that I was running and I wanted to update them do they will use a database template system. Most of the work was all ready done. I just has to add pages and crap like that. I wanted to lean how to use classes and how to set them. So if some one has about an hour to spend on the PC please page me on Yahoo IM by adding bigjoe11a to your Yahoo IM List. Maybe be you can help me figure out why only some of this works and some of it doesn't. If would be an idea to had speakers and a mic too. Joe bigjoe11a@yahoo.combigjoe11a@gmail.com
×