Jump to content

blogfisher

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://smashingfeeds.com

Profile Information

  • Gender
    Not Telling

blogfisher's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. true... i am not sure why are there so many queries where it can be done with a single query. Just check in databse if username is already present then throw an error, else inter it.
  2. Hello, I want to know the webpage to return back after submitting forms in php. MY application contains basically one php file e.g. info.php which shows users info 10 users data on one page. When user click on NEXT button it shows another 10 as info.php?next=1, info.php?next=2 ... Page has a form code where i am taking basic inputs such as name, address, email etc. When user submit these data, i call a adddata.php file which add data to my database. Now i want to know which webpage i have to go back. if form is submitted from info.php?next=1 or infor.php?next=5 ...then i should return to same page. Is there any php function available to know the previous webpage from where form is submitted ? Well, simple way is to pass page number 1,2... along with form data, however i would like to know is this possible without passing this info ?
  3. Thanks for all your help.. finally i used simply traditional method ...updating table by simple UPDATE query by coping each field
  4. Stephen, Thats not working.... looks like this is not possible or we dont have enough knowledge to know how to do that ... ;(
  5. Hello Stephen , I am not sure how to do it. I tried but still giving error. That example updates entire table so no need to take reference of any id. I changed it in following ways. Each one is giving the same error and not working : 1. UPDATE Tbl1 SET ROW = (SELECT FROM Tbl2 WHERE id = 4) WHERE id = 3 2. UPDATE Tbl1 WHERE id = 3 SET ROW = (SELECT FROM Tbl2 WHERE id = 4) Any error in the statements? or they or not logical ?
  6. I can do that, however i want to know whether this is possible where i know only id and i want to update other fields automatically based on chosen id.
  7. I am not sure why do you want to open popup window in php. PHP is a server side scripting language. So better to do it with javascript which executes on client side...
  8. Hello, I am using php - mysql to update my database. I have two tables in a database. Both have same fields as below: Tbl1 & Tbl2: id, name, address, phone, pin, email I want to update row in Tbl1 where id = 3 with row in Tbl2 with id = 4. I am using below query, however its not working... UPDATE Tbl1 SET (id,name,address,phone, pin, email) WHERE id= 3 SELECT id,name,address,phone, pin, email FROM Tbl2 WHERE id = 4 Is this the correct way ?
  9. I think CURL will help you. I used below function to fetch source code of a webpage : function read_web_page($url) { $ch = curl_init($url); $fp = fopen("d:/test.txt","w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); } pass url of any webpage and it wil save source code to test.txt in D drive. Change it as per your requirement,
  10. Hey Russell... u rock... it works fine... I highly appreciate your quick and correct response.. thanks a lot...
  11. I dint understand it exactly...Russell...well, let me elaborate it a bit more... Consider i fetched two arrays $rowTbl1 & $rowTbl2 from mysql database. Assume in both case we got different no. of rows. $rowTbl1 has 10 rows and $rowTbl2 has 15 rows. Now i want to compare each row of $rowTbl1 with each row of $rowTbl2. I want to do something like below : for ($i = 0; $i<10; $i++) { for ($j = 0; $j<15; $i++) { if ($rowTbl1[$i].cnt > $rowTbl2[$j].cnt) { // do something } } } I'm not sure how to do it ?
  12. I want to index each row fetch through mysql database in php. For example, i have a database having two tables Tbl1 and Tbl2. Now i fetch data as an array : $rowTbl1 = mysql_fetch_array($Tbl1result); $rowTbl2 = mysql_fetch_array($Tbl2result); cnt1Tbl1 = $rowTbl1['cnt']; cnt1Tbl2 = $rowTbl2['cnt']; I want to compare first row's field 'cnt' with each row on Tbl2 data. How to do that ? e.g. if (cnt1Tbl1 > cnt1Tbl2) { // Do something } else { // get 'cnt' of next row from $rowTbl2 if (cnt1Tbl1 > cnt2Tbl2) { // Do something } else { // get 'cnt' of next row from $rowTbl2 if (cnt1Tbl1 > cnt3Tbl2) { // Do something } } }
  13. Hello, Stuck with php time() & date(). Problem is that i am getting date information as "Sun Jul 27 19:56:21 +0000 2008" format. I want to convert them in to the information return by php time() function. For example, $currentTime = time(); return value = 1235754894 that i can convert to required string fortmat as $currentTime = date("l, F j Y", $currentTime); Is there a way to convert "Sun Jul 27 19:56:21 +0000 2008" format to "1235754894" returned by time() ?
  14. Code is as below : $myvar = 'Hello"s'; echo "<FORM NAME=\"myform\" ACTION=\"\" METHOD=\"GET\"> Enter something in the box: <BR> <INPUT TYPE=\"text\" NAME=\"inputbox\" VALUE=\"\"><P>"; echo "<INPUT TYPE=\"button\" NAME=\"button1\" Value=\"Read\" onClick='javascript:readText(this.form, \"".addslashes($myvar)."\")';>"; echo "</FORM>"; <SCRIPT LANGUAGE="JavaScript"> function readText (form, data) { TestVar =form.inputbox.value; alert ("You typed: " + TestVar + "... and ..." + data); } </SCRIPT> The above code works fine. However if i change my input to $myvar = "Hello's" .. code doesn't work ???
×
×
  • 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.