php noob in training

This is a discussion on "php noob in training" within the PHP Forum section. This forum, and the thread "php noob in training are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old May 11th, 2007, 04:19
New Member
Join Date: May 2007
Location: boston
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
php noob in training

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:

Code:
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:
Code:
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old May 11th, 2007, 04:40
Reputable Member
Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 245
Thanks: 6
Thanked 0 Times in 0 Posts
Re: php noob in training

Quote:
Originally Posted by esostigma View Post
Code:
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;
OK, first off, that's the funkiest looking query I've EVER seen. I can't imagine that it would return anything meaningful. For all those lines beginning with "substr", have a look here: http://us2.php.net/substr
Quote:
am i just supposed to pop this into phpmyadmin and write down error msgs, results, etc...?
Not sure I understand your question, but if you're to be given access to a database that has the referenced table and field, I'd definitely plug it into phpmyadmin and have a look.
Quote:
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?
Again, that's the strangest looking query I've ever seen and I'd be surprised if that could run, but it depends on the database, I suppose. I can't help you much beyond that.
Quote:
what does =' mean?
The apostrophe is closing a string. The string begins with "**", so the entire string is:
** ERROR ** NULL Character in : primary_mst.box_addr_stop=
That's why this is sucha bizaree looking query. How do you select a distinct ** ERROR ** NULL Character in : primary_mst.box_addr_stop=
Quote:
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?
primary_mst is the name of a table and box_addr_stop is a field in that table.
Quote:
this is an array? are the numbers locations of cells?
No. Each of those substr lines represents a character (that's the ",1" in each of them.) Once more, no idea what the heck this should return - or even if it would run.

HTH a little. Maybe someone with industrial strength sql knowledge can shed more light on this. Good luck!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old May 11th, 2007, 05:35
New Member
Join Date: May 2007
Location: boston
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: php noob in training

wow, ok thank you grande. you've been a big help.


here is my next one: can you break this down for me as well?

Code: Select all
  	Student Programmers Test 1 of 2 	 	 	 	 	 	 	 	 	  select distinct '** WARN **  Date will convert to NULL: primary_mst.box_name_change=' || box_name_change Alert from primary_mst where
  (box_name_change < '0001' or box_name_change > '99999999') and
  box_name_change <> ' ' and box_name_change <> '00000000';

Last edited by esostigma; May 11th, 2007 at 05:48.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old May 11th, 2007, 06:17
Reputable Member
Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 245
Thanks: 6
Thanked 0 Times in 0 Posts
Re: php noob in training

Quote:
Originally Posted by esostigma View Post
can you break this down for me as well?

Code: Select all
      Student Programmers Test 1 of 2
select distinct '** WARN **  Date will convert to NULL: primary_mst.box_name_change=' || box_name_change Alert from primary_mst where
  (box_name_change < '0001' or box_name_change > '99999999') and
  box_name_change <> ' ' and box_name_change <> '00000000';
I'll do the best I can, but these queries are very foreign to me.
Basically you're looking for some records in a field called "box_name_change" in a table called "primary_mst".

The section that I've highlighted in orange is basically saying, show me records where the box_name_change field is set to a value that is less than 0001 or greater than 99999999 but not equal to 00000000 and not equal to '' (nothing/empty). Most likely this query would return no records unless there are records where box_name_change has a value greater than 99999999.

"distinct" means don't show me duplicate rows. The two vertical lines means "or", but the stuff in blue, purple and red is totally Greek to me.

It's interesting that this is a PHP course, since the focus appears to be on SQL. FYI - there's a great resource for learning the basics of SQL here: http://www.sqlcourse.com - I highly recommend it. You can breeze through it pretty quickly and it will help you to understand better some of what's going on here.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old May 12th, 2007, 00:21
New Member
Join Date: May 2007
Location: boston
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: php noob in training

ok super great response amigo, thank you so much. question: what is this---> ** WARN **

and what is this from the first one at the top of the post:
** ERROR **
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old May 12th, 2007, 01:09
Reputable Member
Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 245
Thanks: 6
Thanked 0 Times in 0 Posts
Re: php noob in training

No idea. Sorry.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old May 12th, 2007, 02:43
New Member
Join Date: May 2007
Location: boston
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: php noob in training

that's ok, thank you!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
phpmysql

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Training Colleges Merlin Webforumz Cafe 1 Sep 10th, 2007 23:23
Training Courses crackafaza Webforumz Cafe 16 Aug 30th, 2007 11:38
on-line training n1gel65 Starting Out 2 Jun 11th, 2007 16:27
javascript training JimNewsome JavaScript Forum 3 Sep 13th, 2006 13:49
UK IT Training company please help ash16 Job Opportunities 0 Apr 4th, 2006 10:36


All times are GMT. The time now is 06:06.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42