-
Posts
4,362 -
Joined
-
Last visited
-
Days Won
11
Posts posted by Zane
-
-
read is a reserved word in MySQL
you can either change the column name to something else...or
in your query surround the word read with backticks (to the left of the ONE key)
`read` -
yeah your right, he can do that
but look at his keys for POST
$variable1 = $_POST['variable1'];
$variable2 = $_POST['variable2'];
$variable3 = $_POST['variable3'];
they're just the same as the name of the variables he wants
so he'd be just as well off using extract.
I don't know why you don't just use the POST vars themselves, directly
$variabel1 = $_POST['variable1'];
echo $variable1;
Does the same thing as
echo $_POST['variable1'];
nothing really different at all. -
extract($_POST);
-
Color me stupid 2.0 Crayon, but I fail to see a hint of any letter forming with those dots.
-
$arr = array("stuff in the array");
funciton myFunction() {
global $arr;
print_r($arr);
} -
you can't grab the scope of another function with global
global is meant to extend the scope of variables outside all function and classes
I don't exactly know what your question is but I can tell you you're not going to be able to grab val1 and val1 from Variable() by asking for globals in Bar()
take a gander at this page and research globals
http://us3.php.net/global
-
Another way of thinking of is....like a till for a register
Like at grocery store, everyone has their own till/register drawer
and each person's drawer begins with a set amount of bills.
You could call that the Till Class
It has 100 dollars
-10 Ones
- 10 Fives
- 2 Tens
- 2 Twenties
When the shift starts there are probably 5 employees that get a new till
so
$beth = new Till;
$john = new Till;
$henry = new Till
$zane = new Till;
$bob = new Till;
5 new instances of a Till
and with each Till you can...... takeFiveDollars()
or takeTenDollars()
$beth->takeTenDollars();
$zane->takeTenDollars();
$zane->takeOneDollar();
$zane->takeTwentyDollars();
$john->giveFiveDollars();
eventually each person's set amount of bills will change
and that is the theory behind objects and classes.....all the employees are objects of Till -
just declare a new instance of that object
e.g
[code=php:0]
$foo = new Foo;
$foo->name = "Bar";
$foo->displayName();
//prints Bar;
$foo = new Foo
$foo->displayName();
//prints nothing at all
[/code] -
It's called AJAX.
here's a basic tutorial on how to use it
http://www.webpasties.com/xmlHttpRequest/
just think of the zipcodes as your db of usernames -
$xtpl is an object of something you have declared earlier in the code.....or even in an included file
somewhere, either above this snippet or in an included file you have said something along the lines of
$xtpl = new Something;
and then in the snippet you're making a variable out of the return of a function from that class
$myvar = $xtpl->resultofmyfunction("pudding");
meaning somewhere in the Something class
you have a function named resultofmyfunction -
reallly looks great....good job
one little glitch I noticed is that on your Search feature
you have Filter and Order switched.....
I don't quite know what Filter is for but I'm pretty sure you can ORDER by (1|2|3|4)
-
or encapsulate it with curly braces
[code=php:0]echo "Welcome back {$log->GetUserName()}";[/code] -
http://us2.php.net/manual/en/reserved.php
Note if your running PHP5, $this is a reserved word
so you can't use it as parameter like this -
np, just keep in mind the community and how it's viewed.
Most likely you didn't offend anyone, but certainly not me but eh what if. -
that mostly concerns IF statements
it won't always return true because by the time it gets to the last record
of your query
mysql_fetch_array will return FALSE.
stopping the loop -
in your php.ini file
look for the first occurance of short_tags
and set it to on, or true or whatever the positive value is supposed to be -
It has a lot of the same aspects or facebook.com...A LOT
except for the ability to change your stylesheet...
Looks like you did a lot of work on this
but all I can do is repeat redbull
why should people join? -
[quote author=Kano link=topic=114272.msg464894#msg464894 date=1163000588]
does <? work the same as <?php
[/quote]
yes, as long as you have short_tags turned on
the only real difference is that you can do echo statements on the fly with short tags
for instance
<?="stuff" ?>
is the equivalent of
<?php echo 'stuff" ?> -
This is backwards
mysql_fetch_array($standings_query) = $table_rows
it should be
$table_rows = mysql_fetch_array($standings_query)
Furthermore, you need to call it $table_row instead so it will work.
seeing as how you're calling $table_row[points] and such
also the word points need to be in quotes
same for name too
i.e.
$table_row['points'] -
the serialize() function is meant just for this situation
http://www.php.net/serialize
$var = array("1","2","3");
$_SESSION['myVar'] = serialize($var); -
[quote]I want to select all the records from courses that don't exist in course_users BUT only where 'user_id' is equal to a seesion var used to id them.[/quote]
[code]
SELECT courses.course_id FROM courses INNER JOIN course_users ON courses.course_id != course_users.course_id WHERE user_id = "whatever"
[/code]
give that a try... -
[quote]prompts them for a username and password?![/quote]
a username and password for what?
Anything in particular.
Secondly, alternatively
check the configuration of your router and make sure DMZ is turned on for your IP -
no, PHP is designed to avoid just that.
Or else you could just steal passwords and everything
-
What's this supposed to accomplish btw..
What's the goal output
Are you just wanting a list the directory for Glen or for every user
What I'm getting at is you could probably do better with a JOIN
SELECT weddings.directory FROM weddings INNER JOIN profiles.user_id ON weddings.user_id = profiles.user_id GROUP BY weddings.user_id;
i don't have anything to test that with so I can't guarentee that'll work
.doc to .pdf using php
in PHP Coding Help
Posted
is to download/upload
an encoder that works from a shell command
and then execute that command from PHP
using exec() or shell_exec()