Jump to content

whiteboikyle

Members
  • Posts

    286
  • Joined

  • Last visited

Everything posted by whiteboikyle

  1. Not really sure what to put for the "Options" Array to fix this query though.
  2. It must be a security issue than. I will look into. Its a direct copy and paste in the query and it pops up rows.. And E_ALL is on.. No errors.
  3. I made sure it was the right directory.. I even did $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC); var_dump($row); and still comes up bool false.. Im thinking maybe a security to the tables?
  4. So we have Sharepoint and I am trying to extract certain information from the sharepoint SQL and code a page to output that data. This is what i have: <?php $serverName = "127.0.0.1"; $connectionInfo = array("Database"=>"SharedServices_DB"); $conn = sqlsrv_connect($serverName, $connectionInfo); var_dump($conn); echo("<br />"); $sql = "SELECT TOP 100 Name = upf.PreferredName, Email = upf.Email, Modified = upf.LastUserUpdate, Property = pl.PropertyName, Value = upv.PropertyVal FROM dbo.UserProfile_Full upf, dbo.UserProfileValue upv, dbo.PropertyList pl WHERE upv.RecordID = upf.RecordID AND pl.PropertyID = upv.PropertyID ORDER BY Name ASC"; $stmt = sqlsrv_query($conn, $sql); if( $stmt === false ) { die( print_r( sqlsrv_errors(), true)); } var_dump($stmt); echo("<br />"); $row_count = sqlsrv_num_rows( $stmt ); var_dump($row_count); while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) { var_dump($row); //$second = $row['Department']; //if($first != $second){ //if($row['Name'] != NULL || $row['Email'] != NULL){ echo('<div id="department">'.$row['Name'].'</div><hr />'); //$first = $row['Department']; //} } sqlsrv_free_stmt( $stmt); ?> I know for sure the $sql works I manually did the query on the sql server and it output all the data i needed. But on the PHP site it is coming up blank not outputting anything. Here are the results of the var_dump
  5. Why would I do that when I am running server 2003?
  6. I'm running: Windows Server 2003 IIS 6.0 Microsoft SQL 2005 PHP 5.3.28 Everything that i have read says, "5.3 got rid of mssql and now uses sqlsrv" so i added extension=php_sqlsrv_53_nts_vc9.dll to my php.ini (and yes it is in the ext folder) and when i run the script $serverName = "localhost\phonebook"; //serverName\instanceName // Since UID and PWD are not specified in the $connectionInfo array, // The connection will be attempted using Windows Authentication. $connectionInfo = array( "Database"=>"XXXXX", "UID"=>"XXXXX", "PWD"=>'XXXXXXXX'); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) { echo "Connection established.<br />"; }else{ echo "Connection could not be established.<br />"; die( print_r( sqlsrv_errors(), true)); } i get
  7. Im use to PHP and doing a query seems similar but i need help with syntax. I have an XML file that looks like this and i am trying to do a query where it will search for "ES2UA1" and i get the data "IP" and "Location" I know i am some where in the ball park with Dim doc = XDocument.Load(My.Application.Info.DirectoryPath & ".\xmlData.xml") Dim marker2 = From x In doc...<switchIP> _ Where x.SwitchName = "ES1UA1" _ Select x for each x as y msgbox(y.IP)
  8. Thanks for trying to help but im trying to make the search bar INSIDE the input field.
  9. Is this possible? Pretty much can you do [search here (q)] the q is the search button. IE
  10. THANKS! another question this doesnt really regard that, well kinda, but lets say i exploded it like so $fullName = 'kyle cribbs' $name = explode(' ', $fullName); how would i do a 'like' SQL using an array? like this? SELECT * FROM `users` WHERE `name` LIKE '%$name%'
  11. $name = 'Kyle Cribbs'; how to make this into an array like $array[0] = Kyle; $array[1] = Cribbs; I know there is a php function that will do this but dont know what it is -.- haha
  12. Sorry was originally posted in the framework (which is what im using) but it seems to lack people in that thread so i posted over here.
  13. That is the problem its submitting a blank sql to the database and i have no clue why
  14. friendRequest.php view file <div id="friendRequestForm"> <fieldset> <legend>Friend Request: <?=$this->get_user->getName($segment);?></legend> <?=form_open('friends/addFriend');?> <?=form_textarea('message', 'Message', 'id="messageArea" rows="1" cols="20"');?> <?=form_hidden('userID', $this->uri->segment(3)); ?> <?=form_submit('submit', 'Send Request', 'class="buttons"'); ?> <?=form_close();?> </fieldset> </div> friends.php Construct function addFriend(){ $this->load->model('user_friends'); if($query = $this->user_friends->sendRequest()){ $data['message'] = 'Your friend request has been submitted please wait for the user to accept you!'; $data['main_content'] = 'display'; $this->load->view('include/template.php', $data); } else { $data['message'] = 'An error has accurd'; $data['main_content'] = 'display'; $this->load->view('include/template.php', $data); } } user_friends model <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class user_friends extends CI_Model { function acceptFriend(){ } function denyFriend(){ } function sendRequest(){ $new_member_insert_data = array( 'toUserID' => $this->input->post('userID'), 'fromUserID' => $this->session->userdata('userID'), 'type' => 'friendRequest', 'text' => $this->input->post('message') ); $insert = $this->db->insert('notification', $new_member_insert_data); return $insert; } } im getting a duplicate entry to the SQL when i send request 1 is blank 1 is correct info.
  15. friendRequest.php view file <div id="friendRequestForm"> <fieldset> <legend>Friend Request: <?=$this->get_user->getName($segment);?></legend> <?=form_open('friends/addFriend');?> <?=form_textarea('message', 'Message', 'id="messageArea" rows="1" cols="20"');?> <?=form_hidden('userID', $this->uri->segment(3)); ?> <?=form_submit('submit', 'Send Request', 'class="buttons"'); ?> <?=form_close();?> </fieldset> </div> friends.php Construct function addFriend(){ $this->load->model('user_friends'); if($query = $this->user_friends->sendRequest()){ $data['message'] = 'Your friend request has been submitted please wait for the user to accept you!'; $data['main_content'] = 'display'; $this->load->view('include/template.php', $data); } else { $data['message'] = 'An error has accurd'; $data['main_content'] = 'display'; $this->load->view('include/template.php', $data); } } user_friends model <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class user_friends extends CI_Model { function acceptFriend(){ } function denyFriend(){ } function sendRequest(){ $new_member_insert_data = array( 'toUserID' => $this->input->post('userID'), 'fromUserID' => $this->session->userdata('userID'), 'type' => 'friendRequest', 'text' => $this->input->post('message') ); $insert = $this->db->insert('notification', $new_member_insert_data); return $insert; } } im getting a duplicate entry to the SQL when i send request 1 is blank 1 is correct info.
  16. guess it was just my cache.. working now
  17. Heres how the folders are ROOT -images -- logo.png -style -- style.css #logo { background-image: url("../images/logo.png"); background-repeat: no-repeat; height: 125px; margin: auto; width: 510px; } but the logo wont show up for me =/ http://www.simpleswagg.com
  18. http://simpleswagg.com/profile/view/2 <div id="topWrap"> <div id="topLogo"><h1>Simple Swag</h1></div> <div id="topNav"> </div> </div> <div id="bodyContent"> <div id="messageBody"> <div id="leftBody"> <div id="status"> <div id="yourImage"> <?php $haveImage = false; if($haveImage == true || $haveImage != ''){ } else{ echo '<img src="'.base_url().'/images/yourImage.png" height="105px" width="105px" />'; } ?> <div id="underText"> <?=$profile_name;?> </div> </div> <div id="triangle"></div> <div id="Links"> This is the status of the user. blah blah blah here is some more words.. maybe time to repeat This is the status of the user. blah blah blah here is some more words.. maybe time to repeat </div> </div> <div id="secondBody"> <div id="leftControl"> <p id="misc"> <a href="">Send Message</a> <br /> <a href="">Add as Friend</a> <br /> <a href="">Photos</a> <br /> <a href="">Etc</a> </p> </div> <div id="rightWall"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam egestas felis vel purus elementum elementum. Nam quis nisi at purus dapibus eleifend at ut diam. Vivamus malesuada tincidunt urna et feugiat. Etiam interdum, purus ut interdum tincidunt, arcu tellus ultricies urna, in blandit arcu eros vel urna. Duis id urna leo. Ut malesuada volutpat vehicula. Praesent condimentum vulputate nunc sed feugiat. Sed placerat tempor enim vel lobortis. Cras mollis urna in turpis lobortis eleifend. Praesent sed enim erat. Pellentesque sit amet neque at turpis tristique blandit quis ut dolor. Aliquam vel lectus non diam vehicula bibendum eu eu nibh. In est felis, semper eget ultrices eget, commodo id velit. Mauris imperdiet mollis porttitor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vestibulum viverra mi eget odio gravida molestie. In et quam felis. Vestibulum quis est eget quam mattis vulputate sit amet in mi. Proin consectetur, nisl feugiat suscipit feugiat, metus est bibendum nisi, eu porttitor arcu velit eget libero. Cras fringilla rhoncus odio, non tincidunt mi accumsan quis. Cras lectus neque, venenatis sit amet feugiat nec, mattis in mi. Ut in magna metus, ut hendrerit erat. Praesent vel felis ornare mi vulputate vestibulum. Quisque non lacus vitae quam iaculis varius ut quis dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Morbi pellentesque, tellus non eleifend vehicula, dui dui tristique diam, quis gravida ligula tellus a massa. Nullam pharetra imperdiet enim, in dignissim risus blandit in. Etiam ante mauris, consectetur ut faucibus nec, sagittis ac lacus. Sed non libero sapien, vel accumsan turpis. Proin rutrum auctor dolor, et tristique tellus laoreet id. Morbi ipsum elit, sagittis at ullamcorper nec, vulputate vel libero. Mauris tortor arcu, volutpat a eleifend ac, faucibus non urna. Mauris sed odio at nulla posuere adipiscing. In nec velit ante. In vitae risus libero. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dapibus tristique orci, eget consectetur erat pellentesque vitae. Pellentesque ut eros libero, eu molestie ante. Proin faucibus, lectus sit amet adipiscing tempus, massa orci sollicitudin ipsum, quis tristique dui enim sed velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean dapibus vehicula ante sed placerat. Fusce interdum tellus ut justo rutrum vel tincidunt est rhoncus. Nam ut elit elit. Vestibulum faucibus dolor eget nulla consequat volutpat. Etiam at elit mi. Cras bibendum molestie nulla ac tempus. Integer sed justo sem. Maecenas sed leo quis enim euismod dictum a ut tellus. Pellentesque nec erat arcu, a convallis odio. Quisque eget sem id leo pulvinar hendrerit eget in nulla. Nulla eu libero nunc, vel convallis lacus. Pellentesque id odio neque. Mauris velit urna, pharetra a feugiat et, ornare non tortor. Etiam consequat eros in tortor volutpat adipiscing eget quis nulla. Vestibulum nec mi est. Vivamus interdum, magna ac gravida mattis, nunc orci volutpat velit, ac fringilla quam neque sed ipsum. Fusce tincidunt, mi eu egestas venenatis, nunc sapien placerat quam, nec porta neque magna non sapien. Vivamus sollicitudin sodales nulla, ac mattis lectus mollis sed. Ut tristique est vel nulla vulputate lobortis. Aliquam eros eros, viverra nec imperdiet in, dictum ut augue. Duis sed urna vitae felis mollis facilisis. Nullam non odio nunc, ac euismod sapien. Nunc in odio risus. </div> </div> </div> <div id="rightBody"> <div id="Friends"> <h1>Currently 0 Friends</h1> </div> <div id="Stalkers"> <h1>Currently 0 Stalkers</h1> </div> </div> </div> </div> /* Edited with EditCSS */ /**** LINK-tag style sheet style.css ****/ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { border: 0 none; font-family: inherit; font-size: 100%; font-style: inherit; font-weight: inherit; line-height: 1; margin: 0; padding: 0; text-align: left; vertical-align: baseline; } a img, *:link img, *:visited img { border: 0 none; } table { border-collapse: collapse; border-spacing: 0; } ol, ul { list-style: none outside none; } q:before, q:after, blockquote:before, blockquote:after { content: ""; } a:link, a:visited, a:focus { color: #000000; text-decoration: none; } a:hover { color: #990000; text-decoration: none; } a:active { color: #0000FF; text-decoration: none; } body, html { height: 100%; } body { background-color: #37536D; color: #000000; font-family: helvetica,arial,times; margin: 0; padding: 0; width: 100%; } #radial { background: -moz-radial-gradient(50% 50% , farthest-side, #6497C7, #37536D, #37536D) repeat scroll 0 0 transparent; height: 1500px; left: 50%; margin: -750px 0 0 -750px; opacity: 0.5; position: fixed; top: 50%; width: 1500px; } #fullContain { border: 1px solid black; clear: both; margin: auto; min-height: 600px; position: relative; width: 950px; } #logo { background-image: url("http://64.19.142.13/simpleswagg.com/images/logo.png"); background-repeat: no-repeat; height: 125px; margin: auto; width: 510px; } #container { height: 200px; margin: auto; padding-top: 25px; } #lForm > form { margin: auto; width: 520px; } #submit, #create { float: left; } input[type="text"], input[type="password"] { -moz-border-radius: 5px 5px 5px 5px; -moz-box-shadow: 1px 1px 5px black; border: 1px solid #000000; color: black; float: left; height: 25px; margin: 5px; padding: 5px; width: 200px; } input[type="text"]:hover, input[type="password"]:hover { background-color: #F7F7F7; color: #3A3A3A; } input[type="text"]:focus, input[type="password"]:focus { background-color: #EAEBEB; border: 1px solid #B09B38; color: #000000; } .buttons { -moz-border-radius: 4px 4px 4px 4px; background: -moz-linear-gradient(center top , #703636, #672F2F 50%, #5B2929 51%, #4B1E1E) repeat scroll 0 0 transparent; border: 1px solid black; color: #FFFFFF; font-size: 12px; padding: 8px; text-decoration: none; } #bLogin { -moz-box-shadow: 1px 1px 5px black; float: left; height: 37px; margin: 5px; padding-top: 5px; text-shadow: 1px 1px 2px black; } #bCreate { color: #FFFFFF; margin-right: 15px; margin-top: 15px; opacity: 0.85; position: fixed; right: 0; text-align: center; text-shadow: 1px 1px 2px black; top: 0; width: 50px; } #bLogin:hover, input[type="submit"]:hover { background-color: #662E2E; cursor: pointer; opacity: 1; } .buttons:hover { background: -moz-linear-gradient(center top , #662E2E, #5E2A2A 50%, #532323 51%, #451B1B) repeat scroll 0 0 transparent; color: #FFFFFF; cursor: pointer; opacity: 1; } .input_names { font-size: 14px; padding: 1px; } #username { height: 50px; width: 445px; } #password { height: 50px; width: 445px; } #createAccount { height: 40px; padding-left: 5px; padding-top: 5px; text-align: left; width: 445px; } #goBack { color: #FFFFFF; margin: auto; text-align: center; text-shadow: 1px 1px 2px black; width: 70px; } #subCreate { padding-top: 5px; text-shadow: 1px 1px 2px black; } fieldset { -moz-border-radius: 8px 8px 8px 8px; -moz-box-shadow: 4px 10px 10px rgba(0, 0, 0, 0.6); border: 2px solid rgba(0, 0, 0, 0.6); margin: auto auto 25px; padding: 10px; width: 450px; } fieldset > legend { color: #FFFFFF; font-size: 17px; text-shadow: 1px 1px 2px black; } #aboveContain { margin: auto; padding: 5px; width: 450px; } .error { color: #262626; font-size: 12px; font-style: italic; font-weight: bold; margin: auto; padding: 1px; text-shadow: 1px 1px 6px rgba(250, 0, 0, 0.1); } #urgentMessage { display: none; height: 50px; left: 0; position: relative; width: 100%; } #bodyContent { clear: both; height: 100%; margin: auto; width: 950px; } #topWrap { height: 75px; margin: auto; width: 900px; } #topLogo { font-size: 48px; height: 100%; text-align: center; width: 300px; } #messageBody { -moz-border-radius: 15px 15px 15px 15px; background-color: #36526C; background-image: url("./images/div_bg.png"); background-repeat: repeat-x; border: 1px solid rgba(0, 0, 0, 0.07); clear: both; min-height:510px; height: 100%; margin: auto; padding: 5px; width: 890px; } #leftBody { float: left; min-height: 510px; height: 100%; margin: auto; width: 75%; } #rightBody { min-height:500px; float: left; height: 100%; margin: auto; width: 24%; } #status { margin: auto; padding: 10px; width: 100%; } .linkOrig { float: left; margin: auto; width: 80px; } #Links { -moz-border-radius: 15px 15px 15px 15px; -moz-box-shadow: 1px 1px 5px black; background-color: #FFFFFF; float: left; height: 100px; margin: auto; padding: 5px; width: 475px; } #theLinks { height: 20px; margin: auto; width: 450px; } #subLinks { border-top: 1px solid #E2DFDF; height: 20px; margin: auto; width: 450px; } .linkSub { display: none; } #yourImage { float: left; height: 125px; margin: auto; width: 125px; } #underText { text-align: center; width: 105px; } #triangle { border-bottom: 7px solid transparent; border-right: 7px solid white; border-top: 7px solid transparent; height: 0; margin-left: 119px; margin-top: 20px; position: absolute; width: 0; } #Friends { -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; background-color: #274357; border: 2px solid rgba(0, 0, 0, 0.1); color: #D3D3D3; height: 50px; margin: auto auto 15px; width: 180px; } #Friends > h1 { -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; background: -moz-linear-gradient(center top , #703636, #672F2F 50%, #5B2929 51%, #4B1E1E) repeat scroll 0 0 transparent; height: 15px; padding: 5px; } #Friends > p { font-size: 12px; } #Stalkers { -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; background-color: #274357; border: 2px solid rgba(0, 0, 0, 0.1); color: #D3D3D3; height: 50px; margin: auto auto 15px; width: 180px; } #Stalkers > h1 { -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; background: -moz-linear-gradient(center top , #703636, #672F2F 50%, #5B2929 51%, #4B1E1E) repeat scroll 0 0 transparent; height: 15px; padding: 5px; } #Stalkers > p { font-size: 12px; } #SwaggUp { -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; background-color: #274357; border: 2px solid rgba(0, 0, 0, 0.1); color: #D3D3D3; height: 50px; margin: auto auto 15px; width: 180px; } #SwaggUp > h1 { -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; background: -moz-linear-gradient(center top , #703636, #672F2F 50%, #5B2929 51%, #4B1E1E) repeat scroll 0 0 transparent; height: 15px; padding: 5px; } #secondBody { clear: both; min-height:380px; height:100%; margin: auto; position: relative; width: 100%; } #leftControl { border-right: 1px solid black; float: left; font-size: 12px; min-height:380px; height:100%; padding-right: 5px; width: 20%; } #leftControl > p { -moz-border-radius: 5px 5px 5px 5px; background-color: #FFFFFF; padding: 5px; } #misc { margin: auto; } #rightWall { float: left; min-height:360px; padding: 10px; width: 75%; }
  19. so the table ___friend_____ --userID-- --friendID-- ________________ _____________users______________ --ID -- --name-- --username-- --password-- _______________________________ a foreach within a foreach would work but im not sure how to save all data to an array then sort that array by name then echo, but thats not a very good way of doing it.. seems fairly slow.. I am pretty sure the way the user 'the_little_guy' said it would make sense.. Just never seen that done, and a little more info would help..
  20. I did a google search.. I explain in the best way possible.. its a table that has a userid and a friendid.. Thats it... How would orderby order a users name that is on a completely different table. I have more knowledge in PHP then CSS thus i would know the 'orderby'. If you were the OP and i replied with that you would of said the same thing. I didnt any way disrespect you nor anyone else. Now premiso on the other hand is... And i did do a google search.. Couldnt find what i was looking for, so posting was clearly a suitable reasoning. and clearly you can see my frustration when posting on here im getting answers that aren't to my understanding, especially on the CSS thread.
×
×
  • 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.