Jump to content

php noob in training


esostigma

Recommended Posts

hi all,

  first off thanks to any  help i receive.

 

  ok, i am being given an open book test in a way to asses my current knowledge (zero) of php.  i am just scrutinizing and breaking it down so that i can understand what the .... is going on.

 

i will have many questions no doubt.

 

here is what i'm looking at right now:

 

select distinct '** ERROR ** NULL Character in : primary_mst.box_addr_stop=' || box_addr_stop Alert from primary_mst where
substr(box_addr_stop,1,1) is NULL or
substr(box_addr_stop,2,1) is NULL or
substr(box_addr_stop,3,1) is NULL or
substr(box_addr_stop,4,1) is NULL or
substr(box_addr_stop,5,1) is NULL or
substr(box_addr_stop,6,1) is NULL or
substr(box_addr_stop,7,1) is NULL or
substr(box_addr_stop,8,1) is NULL;

 

here is what i'm to do:

Include information about the type of query, the data (if any) the query returns, what (if anything) the query is looking for, and any messages the query produces under various circumstances.

 

first question:  am i just supposed to pop this into phpmyadmin and write down error msgs, results, etc...?  i really  need to know what is being done by this code here.  i can identify substr may mean substring... and that the person is trying to possibly look for errors in a variable or table called: primary_mst.box_addr_stop    am i right in guess that?  please if anyone could just explain it to me what is going on here.  thank you , it is much appreciated any help.

 

first thoughts:

.. looking for errors in a table called:  box_addr_stop 

what does ='  mean?

what does primary_mst. mean?  is it that primary_mst. is the name of the table and  the box_addr_stop is a variable containing data in that table? 

this is an array?  are the numbers locations of cells?

Link to comment
Share on other sites

Breaking it down, it has these elements

 

'** ERROR ** NULL Character in : primary_mst.box_addr_stop=' || box_addr_stop

 

This is concatenation.  It sticks together that constant string along with the value of column box_addr_stop

 

select distinct

 

This means duplicate rows will only be shown once.

 

'** ERROR ** NULL Character in : primary_mst.box_addr_stop=' || box_addr_stop Alert

 

This means the output will be named "Alert" when you go to fetch it in php after running the query.  There is an implicit "AS" which can be left out.

 

I can't help you with the "substr(...) is null" part.. you might want to try a few queries in phpmyadmin to see when substr() gives null on certain inputs.

Link to comment
Share on other sites

reply... ok this is why i always wanted to be a designer and NOT a developer.  this stuff just makes me regret being born in a way...

 

no, this is not for a course, this is for a job.  if i can learn php quickly i can possibly get a real job in the real world.

 

 

 

first thoughts:

.. looking for errors in a table called:  box_addr_stop

what does ='  mean?

what does primary_mst. mean?  is it that primary_mst. is the name of the table and  the box_addr_stop is a variable containing data in that table?

this is an array?  are the numbers locations of cells?

 

 

-----------edit

 

also, these people said that they consider php to be very 'learnable'...  do you agree?  i don't really have programming experience.  i design websites through xhtml/css + photoshop.  what do you think ? 

Link to comment
Share on other sites

PHP is one of the easier languages to learn.. still, you will need to work hard at it.  I would suggest daily study and practice if you're going to use it in your job.

 

Yes, primary_mst is the table name.  box_addr_stop is a "column" of the table.  Tables consist of rows, and each row has columns.  For example, an "employee" table would have one row for each employee.  And each row would have a column for "name", "address", "phone", etc etc.

 

Based on your questions here, I suggest you do a tutorial on MySQL.  I think that's the fastest path to being able to understand this query.

Link to comment
Share on other sites

ok great.  super great.  thank you for all your responses.  i guess i am going to just try and study free tutorials online for awhile. i have used php/mysql before,but i was endowed with phpmyadmin and scripts written by others.  i tweaked them nothing more.  anyways, thx again. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.