NYCPHP Meetup

NYPHP.org

[nycphp-talk] Help Request

Edward Potter ejp at well.com
Sun May 19 01:45:21 EDT 2002


the syntax i use, but i'm using Postgres, works fine...

KEYWORD1 = '$keyword1';

and to make it a bit tighter
KW1 = '$kw1';   // KW is close enough to keyword to abbreviate, imho.

ed



Jeremy Hise wrote:

> It would really help if you included the job table definition. 
> 
> For example, it appears as though all the fields in the table are
> strings. But it seems like the field named "comp_id" should be a number.
> If this is the case, then the SQL maybe has a syntax error.
> 
> 
> 
> 
> On Fri, 2002-05-17 at 22:20, Jerry Wing wrote:
> 
>>I am developing for myself a database application that carries job
>>related information for the internet - my own small business.  I have
>>developed scripts for adding and deleting a record, but the script for
>>update record does not work.  The add record script adds values to all
>>the fields of a record, and the delete record script deletes whatever
>>record is selected.  I think the database columns are okay since they
>>work with these two commands.
>>
>>The script for the update record consists of three separate scripts. The
>>first script selects the record to be modified.  The second script
>>displays the fields of the record on the screen.  The third script does
>>the modification with the UPDATE statement.
>>
>>The script that selects the record and the script that displays the
>>field information for the record work fine.. the script that modifies
>>the records does not.
>>
>>I copied the script from PHP Essentials, written by Julie Meloni.
>>
>>If someone would be willing to work one on one to look at the three
>>scripts (record selection, record display, and record modification, i
>>would greatly appreciate it.....I would like to e-mail them to you as i
>>do not have a server to post them on, or I can send them by icq or
>>irc.... here is the third script that is not working (i get no error
>>message... apparently it is executing but--------:
>>
>><?php
>>If ($var2=="Return To Admin Home Page"){
>>        header("Location:index.htm");
>>        exit;
>>}elseif ($var1=="Modify Database"){
>>
>>                $connection = mysql_connect("localhost", "jwing",
>>"xxxxxxxx")
>>                        or die ("Couldn't connect to server.");
>>                
>>
>>                $db = mysql_select_db("jwing", $connection)
>>                        or die ("Couldn't select database.");
>>
>>$sql = "update jobs 
>>set 
>>KEYWORD1 = \\"$keyword1\\",
>>KEYWORD2 = \\"$keyword2\\",
>>KEYWORD3 = \\"$keyword3\\",
>>KEYWORD4 = \\"$keyword4\\",
>>KEYWORD5 = \\"$keyword5\\",
>>COMP_ID = \\"$comp_id\\",
>>SHOW_DATE = \\"$show_date\\",
>>JOB_CAT = \\"$job_cat\\",
>>JOB_LOC = \\"$job_loc\\",
>>JOB_TITLE = \\"$job_title\\",
>>JOB_DESC = \\"$job_desc\\",
>>JOB_SALARY = \\"$job_salary\\",
>>FIRST_NAME = \\"$first_name\\",
>>LAST_NAME = \\"$last_name\\",
>>AD_EMAIL = \\"$ad_email\\",
>>CNTCT_EMAIL = \\"$cntct_email\\",
>>USR_NAME = \\"$usr_name\\",
>>P_WORD = \\"$p_word\\",
>>AD_PHONE = \\"$ad_phone\\",
>>CNTCT_PHONE = \\"$cntct_phone\\",
>>AD_FAXPHONE = \\"$ad_faxphone\\",
>>WEB_SITE = \\"$web_site\\",
>>CCNAME = \\"$ccname\\",
>>CCNUMBER = \\"$ccnumber\\",
>>MONTHEXP = \\"$monthexp\\",
>>YEAREXP = \\"$yearexp\\",
>>CCTYPE = \\"$cctype\\",
>>STREET1A = \\"$street1A\\",
>>STREET2A = \\"$street2A\\",
>>STREET3A = \\"$street3A\\",
>>CC_CITY = \\"$cc_city\\",
>>CC_STATE = \\"$cc_state\\",
>>CC_ZIP = \\"$cc_zip\\",
>>TRBLFONE = \\"$trblfone\\"
>>where job_id = \\"$job_id\\"";
>>
>>$sql_result = mysql_query($sql) or die (mysql_error());
>>echo "
>><HTML>
>><HEAD>
>><TITLE></TITLE>
>></HEAD>
>><BODY background=\\"rimmabg.jpg\\">
>><FORM METHOD=\\"POST\\" ACTION=\\"jl2s1s.php\\">
>>
>><input name=\\"var1\\" value=\\"Return To Admin Home Page\\"
>>Type=\\"submit\\">
>>
>></form>
>></BODY>
>></HTML>
>>";
>>};
>>?>
>>
>>
>>
> 
> 
> 
> 
> 
> 





More information about the talk mailing list