miancu
-
Posts
14 -
Joined
-
Last visited
Never
Posts posted by miancu
-
-
Just a tip to display your array nicer, maybe even more sugestive:
echo "<pre>"; print_r($arr); echo "<pre>";
And your problem can be easily solved with a foreach loop:
foreach($arr as $index=>$item){ echo $item['id']; //also available for further manipulation }
Hope this helps!
-
The trick I used was to give fixed width and float:left to the left DIV and no floating and no width to the DIV in the right. The right div aligns by itself on the left and takes the entire space(100%).
Hope this works for you too!
-
I don't see enctype="multipart/form-data" for the edit page <form>.
-
I hope this will make it easier to understand:
http://davidwalsh.name/php-shorthand-if-else-ternary-operators
-
do you mean :like this?
$string = ($Statuts == "01")? 'Online!' : 'Offline!' ;
-
Does this help?
// I assume you know which project ID you want = $projectID echo "projectname: ". $projects[$projectID]['projectname'] . "<br />"; echo "targetlang: ". $projects[$projectID]['targetlang'] . "<br />"; //... more values to display here according to the key - targetlang , sourcelang , units
If this is not what you need, please give more details, because I am a little confused on what you need here.
-
you're welcome! glad to help!
it would probably work somehow with your version too, but i didn't try it, since it seemed to complex and i didn't really have an example to see them.
-
I think you got lost in so many arrays you're using. If I understand correctly your needs, you might be able to simplify your $rows array when you retrieve the data from database:
$projects = array(); //this is instead of your $rows foreach($projectIDs as $row => $value) { $query = mysql_query("SELECT * FROM ".PROJECT_TABLE." WHERE id = '$value' "); $row = mysql_fetch_array($query); $projects[$row['id']] = array(); $projects[$row['id']]['projectname'] = $row['projectname']; $projects[$row['id']]['projecttype'] = $row['type']; $projects[$row['id']]['sourcelang'] = $row['sourcelang']; $projects[$row['id']]['targetlang'] = $row['targetlang']; $projects[$row['id']]['units'] = $row['units']; // continue here with rest of variables you have }
You could then use $projects array for further display or manipulation.
Let me know if this helps you!
-
try using parseInt() for the value in the form.
Hope this helps!
-
My idea will be to have a separate function where you get all results from database with (post_numb>just deleted post_numb) ordered by post_numb ASC and using an counter(in PHP) to update each field post_numb with that counter(that starts from just deleted post_numb to the total number of records). You call this function every time you do a delete post and have the deleted post_numb as a param for the function.
If you have a lot of records in the database, this function might be a little time consuming, so you might just want with the second option I have you.
Hope this is helpful!
-
maybe every time you have the delete post operation called, you can add a function called to reorder the post_numb values to avoid having missing numbers. or maybe you should just get them ordered from database after the post_num and then use an index to display #1,#2, etc in the php.
hope this helps!
-
i found this, maybe it helps you:
http://www.farad.com.au/source_code/php/setting_floating_point_precision_src.php
-
try something like:
SELECT a.* FROM allusters a
INNER JOIN doctors d ON a.id=d.obj_id
WHERE d.value='provider'
if I understood the requirement, this should work to give the allusters that are providers.
hope this helps!
-
Hi everybody!
My name is Miha, I am from Romania, but I've been living in US for almost 2 years now. I've been developing in PHP(also HTML/CSS/Javascript and Mysql) for 5 years now, and I've been involved in various projects, small or big. I am sure I still have a lot to learn and I am here to see what else is there in the PHP world and web application architecture as well as to offer my help and advice when I can.
See you guys around here!
This query returns 2 of the same result... ?
in PHP Coding Help
Posted
try to use an INNER JOIN instead of this select from 2 tables. Also manipulate the $email var before adding it to the query so it is in the needed format 'email1@..,email2@..' and add the var without the ''. try it like this:
SELECT u.avatar, u.displayname, p.about_me
FROM users u INNER JOIN profiles p ON p.user_id = u.id
WHERE u.email IN ($email) AND LIMIT $offset, $rowsperpage
hope this helps!