GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 15-Aug-2003, 03:45
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

update problem


hi,
i created 3 fields

<form action="dirmodify.php" method="post">
<tr>
<td> <input type="radio" name="ddir" value="<?=$r->sys_pk ?>" id="dir<?=$r->sys_pk ?>" /></td>
<td>Directory:&nbsp;</td>
<td><input type="text" name="name" size="20" /></td>
<td><input type="submit" name="modify" value="Modify"</td>
</tr>
</form>
this radio display some files from database when i select some file let say FORUM it display in text field and when i chnage the name to FORUM1 and submit the form its not at all updating name i dont no why

and in dirmodify.php

PHP Code:

<? $dir = './'; require($dir.'lib.php'); get_session(); ?>
<?
expire_header();
$ddir = $HTTP_POST_VARS['ddir']+0;
// modifying directories
         if ($modify && $ddir) {
   query_db_trad("UPDATE t_directories SET name = $name WHERE sys_pk = $ddir");//whats wrong in this query
           }
    
?>


thanks in advance
  #2  
Old 15-Aug-2003, 06:54
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
I have no idea what is value="<?=$r->sys_pk ?>" and the function query_db_trad().

But, you can try to hard-code the script temporarily by inserting a valid $ddir value inside the SQL string, e.g.:
PHP Code:

<?php
query_db_trad( "UPDATE `t_directories` SET `name` = '$name' WHERE `sys_pk` = 3" );
?>


If it works, then you know it's a HTML / form issue instead!

Also, always quote string values in SQL statements...
  #3  
Old 15-Aug-2003, 07:00
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
Thanks JDK now it works fine with your recommended query

query_db_trad("UPDATE t_directories SET name=\"$name\" WHERE sys_pk = $ddir");

now it works fine

Regards
 
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with php5 cgi installation fab13 Apache Web Server Forum 3 19-Nov-2003 09:11
unwanted scrollbar problem kelly001 Web Design Forum 3 24-Oct-2003 10:44
link problem [1][2]----- zuzupus MySQL / PHP Forum 0 16-Sep-2003 05:16
Google Update and DeepCrawl Alert JdS Search Engine Optimization Forum 24 16-Aug-2003 05:35
textarea width problem zuzupus Web Design Forum 2 23-Jul-2003 03:06

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:03.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.