Posts
 
Reputation
Joined
Last Seen
Ranked #551
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
34
Posts with Upvotes
31
Upvoting Members
25
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
6 Commented Posts
5 Endorsements
Ranked #341
Ranked #396
~68.2K People Reached
Favorite Tags

98 Posted Topics

Member Avatar for aneeqtariq_143

I have the same requirement so I wrote a few lines that would demonstrate the answer to your question and give me a base to work from. <?php if (isset($_POST['submitted'])){ print_r($_POST); } ?> <html> <head> <script type="text/javascript"> function addTextArea(){ var div = document.getElementById('div_quotes'); div.innerHTML += "<textarea name='new_quote[]' />"; div.innerHTML += …

Member Avatar for diafol
0
7K
Member Avatar for davy_yg

I think you are confusing two file system types; localhost is for the browser address bar and relates to hostnames, but the script needs the system path. If 'install.php' is in the same directory, then you can try `'./install.php'` (./ is shorthand for this directory). You need to give the …

Member Avatar for Alberto Bucur
0
170
Member Avatar for ricardojorge.net

@ricardojorge register.php line 35: `$r = mysql_query($q);` add some error checking: `if(!$r = mysql_query($q)) die(mysql_error());` do you get an error message? @lastmitch I agree with you, but I fancied the challenge and was already looking :)

Member Avatar for Ank1
0
456
Member Avatar for anirban1087

I copied your code into my own page and ran it and got a result with FF, IE and Chrome: object(SimpleXMLElement)#1 (1) { [0]=> string(5) "52.82" } Strange...

Member Avatar for R0bb0b
0
293
Member Avatar for adam.adamski.96155

Hello :D I am using the twitter API to perform a search for a certain author, and storing the results in a database so that I can perfrom an action on each entry. However, there are many duplicate results that have small differences at the beginning of the string or …

Member Avatar for adam.adamski.96155
0
4K
Member Avatar for adam.adamski.96155

Hello :) I'm working with a database of postcodes. I have an existsing query that returns the postcodes within a certain radius: `select *, acos(cos(51.496502411798 * (PI()/180)) *cos(-0.13982862499836 * (PI()/180)) *cos(lat * (PI()/180)) *cos(lng * (PI()/180))+cos(51.496502411798 * (PI()/180)) *sin(-0.13982862499836 * (PI()/180)) *cos(lat * (PI()/180)) *sin(lng * (PI()/180))+sin(51.496502411798 * (PI()/180)) *sin(lat …

Member Avatar for pritaeas
0
139
Member Avatar for GraficRegret

Hey GraficRegret, welcome to Daniweb :) Your description sounds like a typical use of PHP and MySql, but what help do you specifically need? Is there some code you need some assistance with? Are you looking for general considerations and tips from those who already walked that road?

Member Avatar for diafol
0
182
Member Avatar for bops

There are probably better ways, but I would make a temporary database with mysql and store them in there for easier manipulation. I would write a script to insert a few hundred at a time, and add the records gradually to avoid PHP execution limit, with an echo for every …

Member Avatar for bops
0
1K
Member Avatar for Farhad.idrees

I see the problem: `function validateForm(Qform)` expects a parameter passed with the function call, but you pass nothing: `onSubmit="validateForm();` change it to: `onSubmit="validateForm(this); return false;"` and it should work okay.

Member Avatar for Farhad.idrees
0
332
Member Avatar for bettybarnes

Your database section looks a little mamlformed, specifically this line: `while ($query !=-1 && $row = mysql_fetch_assoc($query)) {` I would guess that the previous line: `$values = mysql_fetch_assoc($query);` already collected the necessary information, so if this line: `echo print_r($values, true);` prints the correct information, I would try changing your code …

Member Avatar for adam.adamski.96155
0
164
Member Avatar for amith_ami

Line 32: `$sql="INSERT INTO tbl_candidate(email_id) VALUES('$email_id1');` has a missing quote before the semi-colon. Line 39: `else{` is missing the preceding curly brace. Fix those, see what happens.

Member Avatar for amith_ami
0
98
Member Avatar for dinhunzvi

`if(isset($_POST['id']) && ($row['bankID'] == $_POST['id']))` or, `if(isset($row['bankID']) && ($row['bankID'] == $_POST['id']))` depending which key is not set. It's good that you have all errors showing.

Member Avatar for adam.adamski.96155
0
346
Member Avatar for manivannan.ajith

This hurts me more than it hurts you, but... [Let me google that for you!](http://lmgtfy.com/?q=what+is+json%3F)

Member Avatar for JorgeM
0
106
Member Avatar for albert.sibanda.9

Welcome to Daniweb **albertsibanda9** :) The long answer: [Read This Before Posting A *second* Question](http://www.daniweb.com/web-development/php/threads/435023/read-this-before-posting-a-question) The short answer: Post your code before LastMitch gets hold of you :D

Member Avatar for LastMitch
0
198
Member Avatar for tibor.marias

check for result if($result = mysql_query("SELECT * FROM table")){ while ($row = mysql_fetch_array($result)){ // don't echo immediately, store in $string $string .= '["' .$row[1]. '",' .$row[2].'],'; } // now $string has an extra comma... $string = substr($string, 0, -1); } use [substr()](http://uk3.php.net/manual/en/function.substr.php) to select all but last character, then echo …

Member Avatar for diafol
0
152
Member Avatar for shahai.ali

> but i want to show the error in such a way that name of the tables couldn't be shown... Is that all? `$query = mysql_query("DELETE FROM table_2 WHERE tchr_id='".$id."'") or die("Oops, we have a problem, please contact the administrator.");` Change message to suit.

Member Avatar for adam.adamski.96155
0
205
Member Avatar for shahai.ali

`$alert_error = "<script type=\"text/javascript\"> alert('".mysql_error()."') </script>";` In the above line you are referencing `'mysql_error()'`, but it doesn't exist yet because you did not run the query that produces the error. Also, you wanted Javascript to alert the value of `'mysql_error()'`: if (!$query = mysql_query("DELETE FROM abc WHERE id ='$id'")){ echo …

Member Avatar for shahai.ali
0
616
Member Avatar for mpc123

This is simple maths, use parentheses to force calculations in correct order: `field3 minus (field1 divided by field2)` $result = ( $row['field3'] - ($row['field1'] / $row['field2']) ); echo "<td>".$result."</td>";

Member Avatar for mpc123
0
175
Member Avatar for bitejones

There are probably better ways, but If I had to achieve it with existing knowledge, I would do something like this: $wordString = $_POST['search']; /* first test there are comma separated values */ if (strpos($wordString, ",")){ /* split string into array of strings on the comma */ $words = explode(",", …

Member Avatar for adam.adamski.96155
0
208
Member Avatar for dodgers125

@kevinp2012 seriously, are you asking the OP to improve **his** English? @dodgers125 I'm not *sure* what you want but maybe I can give some pointers about your code: <!-- header row, the 1 must be in quotes: border="1"--> <table border="1"> <tr><th>Sale Number</th> <th>Item</th> <th>Item Cost</th> <th>Units Sold</th> <th>Sale Cost</th> </tr> …

Member Avatar for adam.adamski.96155
1
232
Member Avatar for Riu 2009

Using javascript: <head> <!-- You must have the id set in the next line --> <link id="stylesheet" rel="stylesheet" type="text/css" href="default.css" /> <script type="text/javascript"> function switchStyle(el){ //get selected theme var styleSheet = el.options[el.selectedIndex].value; //apply the new style using id set earlier. document.getElementById('stylesheet').href = styleSheet; } </script> <body> <!-- (this) refers to …

Member Avatar for diafol
0
254
Member Avatar for Rizi004

I believe we have two insert types with MySQL: `"INSERT INTO tablename set field='value', column='amount'..."`, and `"INSERT INTO tablename (field, column) VALUES ('value', 'amount')"` But your query is a mixture of both and neither: `"INSERT INTO ".$table." values $fld='$this->add_security($val)'"`

Member Avatar for adam.adamski.96155
0
137
Member Avatar for Riu 2009

`$check= mysql_query("SELECT FROM accounts WHERE (email='".$email."')");` Select what from accounts? ALL, Id etc? I guess error checking the query would have given an error.

Member Avatar for Riu 2009
0
126
Member Avatar for xbat

**@xbat**, from what I can see, `'q'` is not defined in your JS code, it is not even referenced, so it can't be JS that's giving the error. The only way I can understand this undefined error regarding 'q' is the processing page, testwopart1.php. The beginning of the script (testwopart1.php), …

Member Avatar for xbat
0
426
Member Avatar for MarkieJye

A standard array of checkboxes: <input type="checkbox" id="unicycle" name="cycle[]" value="1">I have one wheel. <input type="checkbox" id="bicycle" name="cycle[]" value="2">I have two wheels. <input type="checkbox" id="tricycle" name="cycle[]" value="3">I have three wheels. Now, echoed with PHP: <?php //escaping the double quotes: echo "<input type=\"checkbox\" id=\"unicycle\" name=\"cycle[]\" value=\"1\">I have one wheel."; //using single quotes: …

Member Avatar for MarkieJye
0
160
Member Avatar for flynismo

It may well be possible to get all the things you want in one query, using the Join technique, but that is for someone else to tell you, have a look [here](http://www.daniweb.com/web-development/databases/mysql/threads/437575/combine-two-queries-into-one) :D As for looping through the way you mentioned: <?php $cityArray = new array(); $sql = "SELECT city …

Member Avatar for flynismo
0
123
Member Avatar for Khav

**vaultweller123** is exactly right. If you declare a variable: `$variable = "value";` ...and then you declare the same variable with a different value: `$variable = "another value";` ...the variable holds the second value and the first value is lost. It is the same in your loop, your variable '$url' can …

Member Avatar for adam.adamski.96155
0
413
Member Avatar for Albert Pinto

I read through the code you posted, it was messy and I felt dirty and soiled :D But your question is: > any idea how to pass the selected data to the backend page once i click submit ...?? ...and my answer is yes, I have plenty idea, and I …

Member Avatar for Albert Pinto
0
1K
Member Avatar for AndreRet

I don't see how the hidden input can possibly be populated with the intended value because it is PHP that echoes the value and PHP won't do anything once the page is loaded. `$_POST['brand']` needs to exist when the page is loaded for PHP to echo the value onto the …

Member Avatar for AndreRet
0
242
Member Avatar for php_noob

I answered the same question yesterday so I can just copy and paste :D You need to make sure all your form elements are contained within a form declaration: <form action="page_that_will_process_form.php" method="post"> <input type="text"... /> <input type="button"... /> </form> Make sure each input has a unique name. <input name="unique_name"... /> …

Member Avatar for adam.adamski.96155
0
154
Member Avatar for amith_ami

It means that Invalid arguments were passed to the implode function on line 40 of the /home/tjconsul/public_html/admin/actions/act_addcandidate1.php file. Show your code.

Member Avatar for adam.adamski.96155
0
2K
Member Avatar for jspence29

Was your code hit by a truck? #nav ul { width: 100%; float: left; margin: 0 0 0 0; padding: 0; list-style: none; background-color: #fff; position: absolute; top: 162px; left: 550px; } You have 100% width AND absolute positioning, I guess the unecessary whitespace is 550 pixels.

Member Avatar for adam.adamski.96155
0
175
Member Avatar for SMode55

`if (user.lenght<5)` <-- typo of the word length. There may be other things, but your code is so messy I need to format your nested loops to make any sense of them. There is a great article here regarding the format of your code and loops: http://phpmaster.com/practical-refactoring-1/

Member Avatar for SMode55
0
177
Member Avatar for HunainHafeez

Both of your functions have the same name, so presumably the second version is overwriting the first one, meaning that really there is only one function - the second one. Did you try to name the two functions differently and add both functions to the onclick event of the button? …

Member Avatar for minitauros
0
235
Member Avatar for AliHurworth

That JS line that produces the radio group has gone horribly wrong :D The best way forward is to look at the exact syntax of a static radio group: <input type="radio" name="overall" value="0">0 then escape the double quotes: <input type=\"radio\" name=\"overall\" value=\"0\">0 then put it inside the document.write function: document.write("<input …

Member Avatar for adam.adamski.96155
0
211
Member Avatar for gcclinux

`$num=mysql_numrows($result)` is wrong, it should be: ` mysql_num_rows($result);` How strange that the script tests that $query exists (which is a string that is defined the previous line), then sends the query to the DB without any error checking: `$result=mysql_query($query);`

Member Avatar for adam.adamski.96155
0
191
Member Avatar for adam.adamski.96155

I have two tables, author and quote: author: AID, Name, YOB, YOD. quote: ID, AuthID, Content. I currently get all the authors with one query and as I loop through them, I run a second query to get the count of quotes that have the current AID: $sql = "SELECT …

Member Avatar for Icone
0
295
Member Avatar for rollerhockey97

The [...] after the variable is not necessary with PHP, so it's `foreach($_POST['check'])`

Member Avatar for rollerhockey97
0
318
Member Avatar for darren2005

There could be a problem with your UPDATE statement. I recommend using error checking with all database transactions, for a great guide look here: [mysqli with error checking](http://www.daniweb.com/web-development/php/code/434480/using-phpmysqli-with-error-checking) If your variables are of string type, your update should look like this: `"UPDATE tablename SET column='value' WHERE id='value'"` I know you …

Member Avatar for darren2005
0
162
Member Avatar for opawix

You have two options - 1. Use Javascript to verify that both passwords match (and the rest of the form is completed correctly) before the form is submitted. Your script appears to be configured that way looking at this line: `<form name="registration_form" method="post" action="register.php" onsubmit="return Validate();">` 2.Use PHP to check …

Member Avatar for opawix
0
210
Member Avatar for Octet

I copied your situation and tested the code on my own wamp server and it worked fine. I moved the include file above the document root and it still worked okay. This wamp server is so sensitive it throws an error if I look at the screen funny.

Member Avatar for Octet
0
256
Member Avatar for MWEB

$query = mysqli_query($con, "SELECT id,price FROM edit WHERE id=$res"); ...this was correct, but lacked the 'ORDER BY' clause, so : $query = mysqli_query($con, "SELECT id, price FROM edit WHERE id=$res ORDER BY id"); ...is all that needed changing, but when urtrivedi changed it to: WHERE id='{$_GET['res]}' ...it went horribly wrong …

Member Avatar for AndreRet
0
174
Member Avatar for Vingklippt

> I am trying to create a **form** that updates mySQL-database. Where is the form?

Member Avatar for Vingklippt
0
220
Member Avatar for PriteshP23
Member Avatar for PriteshP23
0
205
Member Avatar for sofie_mukri

Hey, I liked the challenge, so I tried it out. //in the head section: This function makes the text input elements depending on the number selected in the options. <script type="text/javascript"> function makeInputs(amt){ var str=""; for(i=0;i<amt;i++){ str += "<input type=\"text\" name=\"text_" + (i+1) + "\"" + " id=\"text_" + i …

Member Avatar for sofie_mukri
0
250
Member Avatar for keven.pirritano

It may already be, but your CSS src needs to be relative to your index - [include paths](http://stackoverflow.com/questions/7378814/are-php-include-paths-relative-to-the-file-or-the-calling-code) You can also try an absolute path as a debug test.

Member Avatar for minitauros
0
9K
Member Avatar for websponge

What if you use your friend's details on the PC that works for you? What if your friend uses your details on his machine? What if your friend changes his $_GET['dir'] variable to 'mottram' in the URL? Did you create the upload directory manually or let the script create it? …

Member Avatar for websponge
0
114
Member Avatar for waqar3
Member Avatar for adam.adamski.96155
0
168
Member Avatar for e.patricioparga

a tablename that consists only of digits may need to be encapsulated with \``backtick`\`s - look [here](http://stackoverflow.com/questions/676451/are-you-allowed-to-use-numbers-as-table-names-in-mysql)

Member Avatar for e.patricioparga
0
133
Member Avatar for tapuwa2002
Member Avatar for adam.adamski.96155
0
223

The End.