- Strength to Increase Rep
- +12
- Strength to Decrease Rep
- -3
- Upvotes Received
- 115
- Posts with Upvotes
- 109
- Upvoting Members
- 78
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
627 Posted Topics
Re: Refer to get_result(): http://php.net/manual/en/mysqli-stmt.get-result.php // this is where the data will be stored/buffered $data = Array(); $stmt = $dbconn->prepare("SELECT * FROM `members` WHERE username=? AND password=?"); $stmt->bind_param("ss", $username, $password); $stmt->execute(); $result = $stmt->get_result(); //iterate over the result retrieving one row at a time while ($row = $result->fetch_array(MYSQLI_NUM)) { //buffer the … | |
Re: If you do not want any redirection to take place when viewing the page via ajax, what you can do is to send a parameter that identifies the request as being ajax. In your php code, immediately before the redirect code see if you detect that parameter and if you … | |
Re: try: [CODE] $result_1= mysqli_query($link, "SELECT $criteria FROM table ORDER BY $crieria ASC") or die( mysqli_error($link) ); [/CODE] | |
Re: [QUOTE]making the question I shall ask a fair question.[/QUOTE] So what's your question. You never actually asked a question. On another note, when posting "blocks" of code, wrap them in [ CODE ] and [/ CODE ] (without the spaces around the word "CODE" - I used spaces so you … | |
Re: Read [URL]http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc[/URL] if that directive is enabled on your server and you typed/submitted the following: O'Brian/O'Malley then the server will auto-convert it to: O'Brian\/O'Malley then if you call stripslashes() it will change it back to what you originally typed: O'Brian/O'Malley notice that it removes only BACK slashes, not forward slashes. … | |
Re: What is your PHP INSERT query? Are you by any chance casting the value of `type` to an integer? Also, where is the javscript code that is actually sending the data to the server? The `updateNewsFeed(...)` doesn't seem to be doing anything with the `encodedata` and `url` variables. | |
Re: Try appending the data as a querystring -ex: jq("#myid").load(location.href + " #myid?firstName=John&lastName=Smith"); ![]() | |
Re: From what I see, the `input` and the corresponding `select` can be "tied/related" to each other by inspecting their `id` attributes. By removing the non-numeric portion of the `id`, whatever is left helps you the determine the `id` of the corresponding element. Since `id`s must be unique, the previous method … | |
Re: Are you referring to the `document.write` predefined method? If so, just assign a reference to if for your own `write` property -ex. var subject = new Object(); subject.write = document.write; subject.write("hi");//works as if you had called document.write("...") | |
Re: > And in terms of Finder menu options ... Not sure why they're missing for you FYI - They are not missing for me. However the list of items under my "Favorite Forums" is not the same as what I had prior to the "upgrade." I wonder if I am … | |
Re: You need to fix your `<form>` tag to include `enctype="multipart/form-data"` otherwise the `$_FILES` array will remain empty. Also, you forgot to use `echo` for the `action` attribute. Try: <form name="form1" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" enctype="multipart/form-data">...</form> | |
Re: Try saving the following as test.php and give it a try: <?php if( array_key_exists('Submit',$_POST) ) { if(!empty($_FILES)) { // these are your "settings" $myFiles=Array( 'pri' => Array('required'=>true, 'destination'=>'/path/to/save/directory/', 'allowed'=>'pdf;doc;docx', 'label'=>'Pri') ,'oresult' => Array('required'=>true, 'destination'=>'/path/to/save/directory/', 'allowed'=>'pdf;doc;docx', 'label'=>'OResult') ,'oresult2' => Array('required'=>true, 'destination'=>'/path/to/save/directory/', 'allowed'=>'pdf;doc;docx', 'label'=>'OResult2') ,'dob' => Array('required'=>true, 'destination'=>'/path/to/save/directory/', 'allowed'=>'pdf;doc;docx', 'label'=>'DOB') ,'photo' => … | |
Re: You need `... LIMIT offset, rowCount` -- ex: SELECT blabla FROM a INNER JOIN b ON a.a = b.b ORDER BY a.id DESC LIMIT 50, 10 will give you at most 10 rows, starting with row 50. | |
Re: Try: <select name="cmbclient"> <option value=""></option> <?php /* select only the fields you need. Doing SELECT * gets you all the fields on the table, even the one you don't need! */ $dataSql = 'SELECT reff_number, name FROM pelanggan ORDER BY name'; $dataQry = mysql_query($dataSql, $koneksidb) or die ("Gagal Query".mysql_error()); while … | |
Re: Read through the comments of the script below. Notice that the underlying html markup has changed. <!DOCTYPE html> <?php require 'connect2.inc.php'; $errors=Array(); // Now there is student_id hidden field in the first column. It should correspond to the unique id // record on your table. if( array_key_exists('student_id',$_POST) ) { // … | |
Re: > I can get in, but when I go to log in after, it won't let me log in What you posted doesn't help. You need to post what you are doing before it gets to that point. > and I can re-create the same member multiple times. If you … | |
Re: Try: function getWorkingDays($startDate, $endDate, $holidayList) { $working_days = 0; $begin = strtotime($startDate); $end = strtotime($endDate); if($begin > $end) { echo "startdate is in the future! <br />"; } else { foreach($holidayList as $k=>$v) { $holidayList[$k] = strtotime($v); } $no_days = 0; $weekends = 0; $holidays = 0; while($begin <= $end) … | |
Re: The second parameter of `function createChatBox(chatboxtitle,minimizeChatBox)` should be `chatName` (not `minimizeChatBox`) since you are using `chatName` on line 19. | |
![]() | Re: > How can i simply review Q/A on forum databases See if you find it under `Finder > My Favorite Forums > Databases`. I too was gone for a long time, and now that I am back, the Databases shows up there (along with other ones). If you were actively … |
Re: It is not clear how you are initializing `A[]` but on line 6, if the value of `A[j]` is more than 166, then on line 15, the numeric index for `SUM` would be out of bounds. | |
Re: When `obj.Set_draw ("Rectangle");` is executed, line 90 allocates memory for a Rectangle and `obj` points to it: obj ---> +---+ Rectangle | | +---+ You then execute: `obj.Set_draw ("Circle");`, resulting in: +---+ Rectangle | | +---+ obj ---> +---+ Circle | | +---+ Notice that what your line 90 did … | |
Re: > I have declared the variables in the register_new.php script as $username=$_POST['username']; > $passwd=$_POST['passwd']; The problem is not `$username`. The problem is `$_POST['username']`. If your page is hosted at `yoursite.com/member.php`, when you type that url directly onto the browser's address bar you are submitting a `GET` request (or if you … | |
Re: > However, i would also like to get the roleid returned That implies that you don't know the initial roleid. So your function should not be accepting `$roleid` and shouldn't be part of the `WHERE` clause since you don't know what it is. Try: function getUserRole($username) { $roleid = false; … ![]() | |
Re: try: `SELECT * FROM forums AS F INNER JOIN users AS U ON F.lastAuthorID = U.id` To help you understand `... forums AS F` simply makes `F` an alias for `forums`. Similarly, `... users as U` makes `U` an alias for `users`. The `AS` keyword is optional, so it could … | |
![]() | Re: Based on what you posted, theTicket# column on the light-blue table (to the right of the red table) has unique values. If this is true, then merge Ticket# with the red table and on the purple table instead of Ticket#, use TicketID. TicketCheckList =============== +->* TicketID FK | CheckListID FK … ![]() |
Re: >Therefore, to allow for both, i would need a way for the PHP code to detect whether a request was an AJAX request or not. I don't know how you are submitting the ajax requests, but if you are using jQuery, it already contains a header named `X-Requested-With` which is … | |
Re: > By selecting organization, it will calculate how many customers are there to send SMS, It will display the SMS Count along with all managers names using JQUERY AJAX. > For counting this value,it takes so much time in online, >How to solve that?. Is the customer list on a … | |
Re: If you are going to use `header('Location: ...')`, you cannot use `echo`. So your else clause should be: ... else { $_SESSION['id'] = $row['id']; $_SESSION['user'] = $myusername; $_SESSION["startTime"] = date("r"); //you call header AFTER you have set your session variables. header("Location: index.php"); exit; } | |
Re: On line 11, where are you initializing `$row_injection_text`? I am wondering if you meant to write `$row_pages`? | |
![]() | Re: In HTML, an elements id attribute must be unique. Since you have `<button id='button'>Update</button>` within the `while` construct, all the buttons are getting the same id value. By contrast, your `$('#button')` works only on the first button because it was expecting to find only one to begin with! What you … ![]() |
![]() | Re: Get rid of the `$(document).ready(function(){...});` "wrapper". You need that only when you need to execute something as soon as the page has loaded. In your case, by the time the user selects something, the page is already loaded, so you just need to make the `load()` method call immediately. function … |
Re: > but the javascript is still giving me an error with the obj = JSON.parse(ret); That's because on line 16, you supplied the `dataType: 'json',` option. By doing so, you are telling jquery that the data you are sending from the server is JSON. As a result, when the request … | |
Re: On line 11 you have: $('.codeForm tr:last div[id="status"]').attr('id', '#status' + counter + ''); which ends up generating `<div id="#status">...</div>`. Get rid of the hash symbol. You need the hash symbol only when using selector expressions for jquery, not for the actual ids of the elements. It should be: $('.codeForm tr:last … | |
Re: try: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^/?index\.php\/(.*)$ /index.php [R=301,L] </IfModule> | |
Re: `is_int(1)` should return `true` since 1 is an int primitive. However, `is_int("1")` should return `false` because you are checking a `string` (that happens to have a numeric character, but is a string nevertheless). A form's input (as in `$_POST['id']`) or url parameter (as in `$_GET['id']`) is always a string, even … | |
Re: >I find some of the OO aspects a bit confusing: It seems that an image is turned into an object simply to be able to process it from within an array, programatically. If I am not mistaken, you are referring to lines 17- 23 on your original post. If so, … | |
Re: Try: var commentContent = $('textarea.comment-box#comment'); commentContent.keydown(function(e){ /* see: http://www.quirksmode.org/js/events_properties.html */ var code; if (!e){ var e = window.event; } if (e.keyCode){ code = e.keyCode; } else if (e.which){ code = e.which; } if( code == 13 && !e.shiftKey && commentContent.is(":focus")) { e.preventDefault(); commentForm.submit(); } }); | |
Re: There could be various reasons. To name a few: 1. Invalid/Wrong path to the stylesheet 2. Invalid characters in the stylesheet 3. Improper syntax 4. Insufficient Permissions on the file Open the XSL file directly through FF. If the problem is any of 1-3, then it will tell you on … | |
Re: try: [CODE=html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>JQuery Form Example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> <script type="text/javascript"> $(function(){ $('#myform').bind('submit',function(){ $.post('process.php', $("#myform").serialize(), function(data) { $('#results').html(data); }); }); }) </script> </head> <body> <form name="myform" id="myform" action="" method="POST"> <!-- The Name form field --> <label for="name" id="name_label">Name</label> <input type="text" name="name" … | |
Re: To answer your question, first obtain a reference to your table. If you have your table an id: [icode]<table id='MyTable'>...</table>[/icode] then use [icode]var t = document.getElementById('MyTable')[/icode] to obtain a reference to the table. Since 't' now holds a reference to the table, then assuming you are interested in the x+1th … | |
Re: count is a keyword, so you MUST wrap it in backticks. As a matter of fact, it is better if you always put backticks around your field and table names, that way you will always avoid this problem: NOTE: The general syntax is: [iCODE]UPDATE [COLOR="Green"]`TableName`[/COLOR] SET [COLOR="green"]`fieldName`[/COLOR]='value'[/iCODE] Based on what … | |
Re: [QUOTE] then when I send the paragraph to my mobile phone, I get 162 characters[/QUOTE] see if you have a javascript onsubmit function that changes carriage returns and/or new lines to spaces before submitting. Also, check (for the same thing mentioned above) on the server script to which you are … | |
Re: change: [CODE]mysql_select_db("lola", $con);[/CODE] to: [CODE]mysql_select_db("lola", $con) or die( mysql_error() );[/CODE] Most likely the user aby does not have any privileges on the lola db. ![]() | |
Re: Try changing `include('../../../datalogin.php');` to `require_once('../../../datalogin.php');` to make sure that the file is actually being included. | |
Re: > Test this code For that, you will need to provide the missing javascript file (grid.js). Are you sure you have the correct name/path to the grid.js file? | |
Re: For the sake of clarity, let's say that your site is jonna.com and that your database.mdb is located at jonna.com**/Databases/database.mdb**. try: 'Get the 5 newest news items Set conob2 = Server.CreateObject("ADODB.Connection") conob2.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/Databases/database.mdb") & ";" Set objRec2 = Server.CreateObject("ADODB.Recordset") Dim sql2 sql2="SELECT TOP 5 news_date, news_text … | |
Re: Try: $lines = file(getcwd().'/data.txt'); foreach( $lines as $line) { if( preg_match('/^In our tests\D+(\d+)\D+(\d+)/',$line,$matches) ) { print_r($matches); } } If there are any matches, then the variable ***$matches*** will contain the data you are after. | |
Re: You need to do the iteration on the server (via PHP). Since all four of your PHP array have the same number of elements, iterate over one of them and use that numeric index to retrieve the equivalent element from the other arrays. Try: <?php $tipi = array("asd","222","dda","xcs"); $gun = … | |
Re: You have the right syntax. Just save your program as eigenValues3.js and then if you want to write a program that needs that file you just "import" it as follows: [code] <html> <head> <script type="text/javascript" src="eigenValue3.js"></script> <script type="text/javascript"> //The code that will use the functions in eigenValue3.js goes here </script> … | |
Re: You are currently doing: [CODE=javascript] if( conditions ) { ... required: true ... } [/CODE] If you look closer at your working example, your required is NOT true|false, it is a reference to a function that returns true or false. So, instead of what you have (and is not working) … |
The End.