-
Posts
49 -
Joined
-
Last visited
Never
Everything posted by ReKoNiZe
-
SELECT COUNT(*) As TotalNumber FROM new_members WHERE mode="visa" That will list a TotalNumber of the times visa was used.
-
Insert a remote picture as a blob in mysql from a remote url
ReKoNiZe replied to sebababi's topic in PHP Coding Help
Please use code tags, your code makes my eyes bleed $fileName = $_FILES['imagefile']['name']; $tmpName = $_FILES['imagefile']['tmp_name']; $fileSize = $_FILES['imagefile']['size']; $imtype = $_FILES['imagefile']['type']; @list(, , $imtype, ) = getimagesize($_FILES['imagefile']['tmp_name']); // Get image type. if ($imtype == 3) // cheking image type $imageextension="png"; // to use it later in HTTP headers elseif ($imtype == 2) $imageextension="jpeg"; elseif ($imtype == 1) $imageextension="gif"; else $msg = 'Error: unknown file format'; $fp = fopen($tmpName, 'r+'); $content = fread($fp, filesize($tmpName)); //reads $fp, to end of file length $instr = fopen("latest.img","rb"); $image = addslashes(fread($instr,filesize("latest.img"))); -
[SOLVED] how can i avoid long words on string??
ReKoNiZe replied to yami007's topic in PHP Coding Help
Or maybe he wants like: if(strlen($variable) > 12) echo 'String is too long, try again'; else echo 'Your string is short enough, you may enter'; -
Need help in modifying script to search database. Thank you!
ReKoNiZe replied to bchandel's topic in PHP Coding Help
SELECT * FROM Business WHERE City LIKE '%$variable%' -
Why not juse use the empty function? empty returns true and false.
-
[SOLVED] combining two WHILE statements into one
ReKoNiZe replied to dachshund's topic in PHP Coding Help
In the main commentrows while loop, you could try do a query for that users_id. So you could do: $userQuery = mysql_query("SELECT * FROM users WHERE id = '$sessionname'"); $userresult = mysql_fetch_array($userQuery); if there is a different user for each comment, you will need to change that $sessionname to $commentrows['id'] or whatever you use that has the ID of the commented user. Then you could just do $userresult['username']; and so forth. -
Have it echo the session username to you to see what the current username is then.
-
Must be an issue with the session then if none of them work.
-
Did you try any of them by themselves? Example: if(isset($_SESSION['username'] == "Admin")) And try each one individually to see if its working at all.
-
You need to fix $memberQuery = SELECT member_id FROM member_id WHERE email='$email'. That was just an example, its fairly close to what you need, look at the INSERT INTO query code right above it and follow that standard.
-
[SOLVED] Parse Error that I don't understand.
ReKoNiZe replied to frostyhorse's topic in PHP Coding Help
Line 48, you need another bracket. echo $id . "<a href='view.php?id=$id'>$name</a>" . $age . $color . $breed . $gender . "<br> />"; } needs to be: echo $id . "<a href='view.php?id=$id'>$name</a>" . $age . $color . $breed . $gender . "<br> />"; } } You were missing a closing bracket from your else statement. -
That doesn't make. It should work, I'm not 100% why its not working. Your function must be adding some character we can't see.
-
[SOLVED] Object help please - foreach not working.
ReKoNiZe replied to spires's topic in PHP Coding Help
On this line: if($object->has_attribute($attribute)) { What does has_attribute function do or look like? It looks like you're making an empty object and seeing if it has any attributes, which it won't, hence it returns false. -
Do the query I stated above and select the auto-incremented key(whatever that field is called) and do: $memberQuery = SELECT FROM etc(query earlier) $memberResults = mysql_fetch_assoc($memberQuery); Then you can just do a $memberResults['member_id'];(Or whatever your auto-incremented key is called) to output the member id
-
Hmm.. Show us more code if you can then, sounds like it should work fine.
-
The function in the if statement is a little odd... Try changing echo "Image upload success!"; } to: echo "Image upload success!"; } Do that with the else statement too, putting curly brackets on their own line is good practice and makes things easier to read and find the beginning/end of an if statement.
-
Try changing it to WHERE titulo='$search' to see if that changes anything
-
[SOLVED] Parse Error that I don't understand.
ReKoNiZe replied to frostyhorse's topic in PHP Coding Help
Grab from $id down to $gender and use this instead: echo $id . "<a href='view.php?id=$id'>$name</a>" . $age . $color . $breed . $gender . "<br> />"; -
[SOLVED] combining two WHILE statements into one
ReKoNiZe replied to dachshund's topic in PHP Coding Help
What are you using the userrow for? I see that it provides an image and name to the comments but that information seems like it should be in your other table with the comments. -
Your query looks fine, try making it echo your query so you can see if you have any weird spacing or anything.
-
You could add it right after this: // now we insert it into the database $insert = "INSERT INTO member_id (forename, surname, email) VALUES ('$_POST[forename]','$_POST[surname]','$_POST[email]')"; $add_member = mysql_query($insert); That is where the query is actually made and the information is in the database, so right after that bit of code should work.
-
Looks like you have a floating } at the end there, need to show us more code so we can see where the issue is.
-
[SOLVED] Parse Error that I don't understand.
ReKoNiZe replied to frostyhorse's topic in PHP Coding Help
Go ahead and take the breaks out then and for each variable just do echo $variable1 . $variable2 . $variable3 and so forth. I see no issue on line 70. I would make sure you dont have an extra line at the end of your code. -
Your function looks fine, could you show us the code that does the query?
-
You will need to query what you just inserted. So you could do: SELECT member_id FROM member_id WHERE email='$email' Then just do a mysql_fetch_array() on the query and spit out the member_id